Use same keywords for schemas as metas
This commit is contained in:
27
layouts/partials/paige/func-keywords.html
Normal file
27
layouts/partials/paige/func-keywords.html
Normal file
@@ -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 }}
|
||||
|
Reference in New Issue
Block a user