Use same keywords for schemas as metas

master
Will Faught 5 months ago
parent b36043fdd1
commit 9632f609a4

@ -0,0 +1,27 @@
{{ $page := . }}
{{ $result := slice }}
{{ with $page.Keywords }}
{{ $result = . }}
{{ end }}
{{ with $page.GetTerms "categories" }}
{{ range . }}
{{ $result = $result | append (.Title | markdownify | plainify | htmlUnescape) }}
{{ end }}
{{ else }}
{{ $result = $result | append $page.Params.categories }}
{{ end }}
{{ with $page.GetTerms "tags" }}
{{ range . }}
{{ $result = $result | append (.Title | markdownify | plainify | htmlUnescape) }}
{{ end }}
{{ else }}
{{ $result = $result | append $page.Params.tags }}
{{ end }}
{{ $result = delimit ($result | uniq | sort) ", " }}
{{ return $result }}

@ -4,7 +4,7 @@
{{ $authors := partial "paige/func-authors.html" $page }}
{{ $color := $page.Param `paige.site.color` | default `#0d6efd` }}
{{ $description := $page.Description | markdownify | plainify | htmlUnescape }}
{{ $keywords := slice }}
{{ $keywords := partial "paige/func-keywords.html" $page }}
{{ range $authors }}
{{ $author = $author | append (.Params.name | default .Title | markdownify | plainify | htmlUnescape) }}
@ -12,28 +12,6 @@
{{ $author = delimit $author ", " }}
{{ with $page.Keywords }}
{{ $keywords = . }}
{{ end }}
{{ with $page.GetTerms "categories" }}
{{ range . }}
{{ $keywords = $keywords | append (.Title | markdownify | plainify | htmlUnescape) }}
{{ end }}
{{ else }}
{{ $keywords = $keywords | append $page.Params.categories }}
{{ end }}
{{ with $page.GetTerms "tags" }}
{{ range . }}
{{ $keywords = $keywords | append (.Title | markdownify | plainify | htmlUnescape) }}
{{ end }}
{{ else }}
{{ $keywords = $keywords | append $page.Params.tags }}
{{ end }}
{{ $keywords = delimit ($keywords | uniq | sort) ", " }}
<meta charset="utf-8">
{{ with $author }}

@ -20,7 +20,7 @@
{{ $description := $page.Description | markdownify | plainify | htmlUnescape }}
{{ $expires := cond (not $page.ExpiryDate.IsZero) $page.ExpiryDate false }}
{{ $images := $page.Params.images | default slice }}
{{ $keywords := sort (union (union $page.Keywords $page.Params.tags) $page.Params.categories) }}
{{ $keywords := partial "paige/func-keywords.html" $page }}
{{ $language := site.Language.LanguageCode }}
{{ $license := $page.Param "paige.site.license" | markdownify | plainify | htmlUnescape }}
{{ $modified := cond (not $page.Lastmod.IsZero) $page.Lastmod false }}

Loading…
Cancel
Save