-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added example page for tag shortcode (/examples/shortcodes/tag/) - Added link to example page on example overview page - Fix color for lilac tag - Added styling for tag shortcode - Added html for tag shortcode Testing: check out the example page: /examples/shortcodes/tag/ For https://linear.app/usmedia/issue/CUE-327 Closes #437 as merged as of commit 2d69208. Signed-off-by: Anne van Gorkom <[email protected]> Change-Id: Id6634349f008d84477a444b1315611cc86c1eb81 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1172235 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
- Loading branch information
1 parent
3da5049
commit c1c463f
Showing
9 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Tag | ||
weight: 33 | ||
--- | ||
|
||
To use tags inline use the `{{</* tag */>}}` shortcode. Just add the tag name to the shortcode. | ||
Use quotes around the tag name if it contains a space. Only the tags added to the site Params will work. | ||
If a new tag is needed, also add that one to the params.toml. | ||
|
||
## Examples | ||
|
||
``` | ||
Ecosystem: {{</* tag ecosystem */>}} | ||
Encodings: {{</* tag encodings */>}} | ||
Cue command: {{</* tag "cue command" */>}} | ||
Language: {{</* tag language */>}} | ||
Validation: {{</* tag validation */>}} | ||
Tooling: {{</* tag tooling */>}} | ||
Commented Cue: {{</* tag "commented cue" */>}} | ||
``` | ||
|
||
Ecosystem: {{< tag ecosystem >}} | ||
|
||
Encodings: {{< tag encodings >}} | ||
|
||
Cue command: {{< tag "cue command" >}} | ||
|
||
Language: {{< tag language >}} | ||
|
||
Validation: {{< tag validation >}} | ||
|
||
Tooling: {{< tag tooling >}} | ||
|
||
Commented Cue: {{< tag "commented cue" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package site | ||
|
||
content: examples: shortcodes: "tag": {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Tag | ||
weight: 33 | ||
--- | ||
|
||
To use tags inline use the `{{</* tag */>}}` shortcode. Just add the tag name to the shortcode. | ||
Use quotes around the tag name if it contains a space. Only the tags added to the site Params will work. | ||
If a new tag is needed, also add that one to the params.toml. | ||
|
||
## Examples | ||
|
||
``` | ||
Ecosystem: {{</* tag ecosystem */>}} | ||
Encodings: {{</* tag encodings */>}} | ||
Cue command: {{</* tag "cue command" */>}} | ||
Language: {{</* tag language */>}} | ||
Validation: {{</* tag validation */>}} | ||
Tooling: {{</* tag tooling */>}} | ||
Commented Cue: {{</* tag "commented cue" */>}} | ||
``` | ||
|
||
Ecosystem: {{< tag ecosystem >}} | ||
|
||
Encodings: {{< tag encodings >}} | ||
|
||
Cue command: {{< tag "cue command" >}} | ||
|
||
Language: {{< tag language >}} | ||
|
||
Validation: {{< tag validation >}} | ||
|
||
Tooling: {{< tag tooling >}} | ||
|
||
Commented Cue: {{< tag "commented cue" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- $tagName := .Get 0 | default "" -}} | ||
{{- $tagMap := where .Site.Params.tags "name" "eq" $tagName | first 1 -}} | ||
|
||
{{- if $tagMap -}} | ||
{{- range $tag := $tagMap -}} | ||
{{- $tagValue:= cond (strings.Contains $tag.name " ") (printf "\"%s\"" $tag.name) $tag.name -}} | ||
|
||
<a href="/search?q=tag:{{ $tagValue }}" | ||
class="tag tag--inline{{ if $tag.color }} tag--{{ $tag.color }}{{ end }}"> | ||
{{ $tag.name }} | ||
</a> | ||
{{- end -}} | ||
{{- end -}} |