Merge pull request #22673 from shuuji3/en/fix-glossary-definition-shortcodes-bug
Fix a bug of shortcode 'glossary_definition' which selects a wrong term
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
{{- $prepend := .Get "prepend" }}
|
{{- $prepend := .Get "prepend" }}
|
||||||
{{- $glossaryBundle := site.GetPage "page" "docs/reference/glossary" -}}
|
{{- $glossaryBundle := site.GetPage "page" "docs/reference/glossary" -}}
|
||||||
{{- $glossaryItems := $glossaryBundle.Resources.ByType "page" -}}
|
{{- $glossaryItems := $glossaryBundle.Resources.ByType "page" -}}
|
||||||
{{- $term_info := $glossaryItems.GetMatch (printf "%s*" $id ) -}}
|
{{- $term_info := $glossaryItems.GetMatch (printf "%s.md" $id ) -}}
|
||||||
{{- if not $term_info -}}
|
{{- if not $term_info -}}
|
||||||
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" site.Language.Lang .Page.Path $id -}}
|
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" site.Language.Lang .Page.Path $id -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user