hugo/docs/layouts/_shortcodes/glossary-term.html
Bjørn Erik Pedersen 61a286595e
Some checks are pending
Test / test (1.23.x, ubuntu-latest) (push) Waiting to run
Test / test (1.23.x, windows-latest) (push) Waiting to run
Test / test (1.24.x, ubuntu-latest) (push) Waiting to run
Test / test (1.24.x, windows-latest) (push) Waiting to run
Merge commit 'b3d87dd0fd'
2025-04-24 10:23:16 +02:00

18 lines
632 B
HTML

{{- /*
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 -}}