feat(glossary): provide basic term glossary (#869)
* feat(glossary): provide basic term glossary Enabled a site-wide terminology glossary. * Added the `term` shortcode displaying term definition. * Added the /glossary page showing all term definitions. * Enabled a simplistic search of term definitions. * refactor(glossary): update glossary page links and add callout for Hugo support - Removed the glossary entry from the menu and adjusted weights for subsequent items. - Added informational callouts in the glossary documentation for multiple languages, directing users to the Hugo Glossary Quick Reference. - Updated links in the glossary documentation to point to the correct pages. * fix(glossary): update links to glossary page format across multiple languages - Changed links in the glossary documentation to use Hugo's relref format for consistency. - Updated links in Persian, Japanese, English, and Simplified Chinese glossary pages. --------- Co-authored-by: Xin <5097752+imfing@users.noreply.github.com> Co-authored-by: Xin <xin@imfing.com>
This commit is contained in:
@@ -18,4 +18,20 @@
|
||||
{{- $output = $output | merge (dict $pageLink (dict "title" $pageTitle "data" $data)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Extract glossary data entries */}}
|
||||
{{- $glossaryEntries := dict -}}
|
||||
{{- with (index .Site.Data .Site.Language.Lang "termbase") -}}
|
||||
{{- range . -}}
|
||||
{{- $entry := cond (.abbr) (printf "%s %s %s" .abbr .term .definition) (printf "%s %s" .term .definition) -}}
|
||||
{{- $glossaryEntries = $glossaryEntries | merge (dict .term $entry) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $glossary := dict
|
||||
"title" "Glossary"
|
||||
"data" $glossaryEntries
|
||||
-}}
|
||||
|
||||
{{- $output = $output | merge (dict (relLangURL "glossary") $glossary )}}
|
||||
|
||||
{{- $output | jsonify -}}
|
||||
|
||||
Reference in New Issue
Block a user