Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Add text target component #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions exampleSite/config/_default/menus.en.toml
Expand Up @@ -153,6 +153,12 @@
weight = 3
parent = "solstice"

[[main]]
name = "Text Target"
url = "/components/text_target/"
weight = 3
parent = "solstice"

[[main]]
name = "RSS Feed"
url = "/components/rss/"
Expand Down
15 changes: 15 additions & 0 deletions exampleSite/content/components/text_target.md
@@ -0,0 +1,15 @@
---
title: "Text Target"
date: 2019-04-17T15:52:27-04:00
description: ""
categories: []
keywords: []
slug: ""
aliases: []
toc: false
draft: false
---

You can add a span with an ID to a markdown file using the following shortcode: **{{< text_target id="sample" >}}Text to target{{</ text_target >}}**

{{< text_target id="sample" >}}Text to target{{</ text_target >}}
13 changes: 13 additions & 0 deletions layouts/shortcodes/text_target.html
@@ -0,0 +1,13 @@
<!--
Copyright (c) 2021 Eclipse Foundation, Inc.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.

Contributors:
Martin Lowe <martin.lowe@eclipse-foundation.org>

SPDX-License-Identifier: EPL-2.0
-->
<span id="{{ .Get "id"}}"{{ with (.Get "className")}}class="{{ . }}"{{ end }}>{{ .Inner }}</span>