Skip to content

Commit

Permalink
Fix glossary term linking for plural form
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Jan 20, 2025
1 parent cd95f0f commit 80109a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@
{{- 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 }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/shortcodes/gl.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
{{- 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 }}
Expand Down

0 comments on commit 80109a1

Please sign in to comment.