mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{{/* prettier-ignore-start */ -}}
|
||||
{{- /*
|
||||
We use the front matter keywords field to determine related content. To ensure
|
||||
consistency, during site build we validate each keyword against the entries in
|
||||
data/keywords.yaml.
|
||||
|
||||
As of March 5, 2025, this feature is experimental, pending usability
|
||||
assessment. We anticipate that the number of additions to data/keywords.yaml
|
||||
will decrease over time, though the initial implementation will require some
|
||||
effort.
|
||||
*/}}
|
||||
{{/* prettier-ignore-end */ -}}
|
||||
{{- $t := debug.Timer "validateKeywords" }}
|
||||
{{- $allowedKeywords := collections.Apply site.Data.keywords "strings.ToLower" "." }}
|
||||
{{- range $p := site.Pages }}
|
||||
{{- range .Params.keywords }}
|
||||
{{- if not (in $allowedKeywords (lower .)) }}
|
||||
{{- warnf "The word or phrase %q is not in the keywords data file. See %s." . $p.Page.String }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $t.Stop }}
|
Reference in New Issue
Block a user