mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-08-21 06:26:42 +00:00
Fix glossary term linking for plural form
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user