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

Commit

Permalink
Add text target component (#205)
Browse files Browse the repository at this point in the history
* Add text target component

Signed-off-by: Martin Lowe <martin.lowe@eclipse-foundation.org>

* Fix attribution of text target component to me, its mine.

Signed-off-by: Martin Lowe <martin.lowe@eclipse-foundation.org>
  • Loading branch information
autumnfound committed Mar 4, 2021
1 parent 0dda32c commit 3885791
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
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: **{{&lt; text_target id=&quot;sample&quot; &gt;}}Text to target{{&lt;/ text_target &gt;}}**

{{< 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>

0 comments on commit 3885791

Please sign in to comment.