Files
DOSSIER/website/themes/hextra/layouts/_shortcodes/term.html
T
karim 5a6129bee1 Dokumentations-/Marketing-Website hinzugefügt (Hugo, Hextra-Theme)
Erstmaliger Commit des website/-Unterprojekts (bisher nie versioniert).
Enthält Inhalt/Konfiguration (content/, data/, i18n/, hugo.toml) sowie das
vendorte Hextra-Theme; Build-Output (public/) und Lock-Datei bleiben über
website/.gitignore ausgeschlossen.
2026-10-08 20:25:14 +02:00

34 lines
825 B
HTML

{{- /*
Highlight a glossary term
@param {string} entry Either the glossary abbreviation or the term.
or
@param {string} 0 Either the glossary abbreviation or the term.
@example {{< term entry="MAC" >}}
@example {{< term "MAC" >}}
*/ -}}
{{- $entry := .Get "entry" | default (.Get 0) -}}
{{- $entryLower := lower $entry -}}
{{- $match := dict -}}
{{- $siteData := partial "utils/hugo-compat/site-data.html" . -}}
<!-- Go over the term data file - data/<lang>/termbase.yaml -->
{{- range (index $siteData .Site.Language.Lang "termbase") -}}
{{- if or (eq (lower .abbr) $entryLower) (eq (lower .term) $entryLower) -}}
{{- $match = . -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- with $match }}
<abbr title="{{ .definition | plainify }}">
{{- $entry -}}
</abbr>
{{- else }}
{{- $entry -}}
{{- end }}