Fix glossary term linking for plural form

This commit is contained in:
Joe Mooring
2025-01-19 16:56:27 -08:00
committed by GitHub
parent cd95f0f34e
commit 80109a14f4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -287,9 +287,9 @@ either of these shortcodes in conjunction with this render hook.
{{- end }}
{{- /* Verify that a glossary term page exists for the given term. */}}
{{- if site.GetPage (urls.JoinPath $basePath $termGiven) }}
{{- if site.GetPage (urls.JoinPath $basePath ($termGiven | urlize)) }}
{{- $termActual = $termGiven }}
{{- else if site.GetPage (urls.JoinPath $basePath $termSingular) }}
{{- else if site.GetPage (urls.JoinPath $basePath ($termSingular | urlize)) }}
{{- $termActual = $termSingular}}
{{- else }}
{{- $msg := printf "The %q render hook was unable to find a defintion for either the singular or plural form of the term %q: see %s" $renderHookName $termGiven $contentPath }}
+2 -2
View File
@@ -24,9 +24,9 @@ fragment, it points to an entry on the glossary page.
{{- with $gp :=site.GetPage $basePath }}
{{- /* Validate the given term using its singular and plural forms. */}}
{{- if site.GetPage (urls.JoinPath $basePath $termGiven) }}
{{- if site.GetPage (urls.JoinPath $basePath ($termGiven | urlize)) }}
{{- $termActual = $termGiven }}
{{- else if site.GetPage (urls.JoinPath $basePath $termSingular) }}
{{- else if site.GetPage (urls.JoinPath $basePath ($termSingular | urlize)) }}
{{- $termActual = $termSingular}}
{{- else }}
{{- errorf "The glossary link (%s) shortcode was unable to find a defintion for either the singular or plural form of the term %q: see %s" $.Name $termGiven $.Position }}