Support custom keywords instead of defaulting to using tags

Now can set `keywords:` in the front matter for actual keywords
This commit is contained in:
2024-01-22 20:44:54 -06:00
parent 788583ea23
commit 77afe66aa6

View File

@@ -21,10 +21,14 @@
<meta itemprop="image" content="{{ $featured.Permalink }}"> <meta itemprop="image" content="{{ $featured.Permalink }}">
{{ end }} {{ end }}
{{ with (.GetTerms "tags") }} {{ with .Keywords }}
{{ $tags := slice }} <meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ range . }} {{ else }}
{{ $tags = $tags | append .LinkTitle }} {{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append .LinkTitle }}
{{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }} {{ end }}
<meta itemprop="keywords" content="{{ delimit $tags ", " }}">
{{ end }} {{ end }}