mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
18
docs/layouts/_shortcodes/glossary-term.html
Normal file
18
docs/layouts/_shortcodes/glossary-term.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- /*
|
||||
Renders the definition of the given glossary term.
|
||||
|
||||
@param {string} (.Get 0) The glossary term.
|
||||
|
||||
@example {{% glossary-term float %}}
|
||||
@example {{% glossary-term "floating point" %}}
|
||||
*/ -}}
|
||||
{{- with .Get 0 }}
|
||||
{{- $path := printf "/quick-reference/glossary/%s" (urlize .) }}
|
||||
{{- with site.GetPage $path }}
|
||||
{{ .RenderShortcodes }}{{/* Do not indent. */}}
|
||||
{{- else }}
|
||||
{{- errorf "The glossary term (%s) shortcode was unable to find %s: see %s" $.Name $path $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The glossary term (%s) shortcode requires one positional parameter: see %s" $.Name $.Position }}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user