Improve description meta tag.

This commit is contained in:
Fredrik Jonsson 2025-01-20 10:58:22 +01:00
commit 1994fe787a

View file

@ -13,11 +13,13 @@
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
"url" : {{ .Permalink }},
{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) -}}
"description": {{ . }},
{{ if .IsHome -}}
{{ with $.Param "description" }}"description": {{ . }},{{ end }}
{{ else -}}
{{ with .Description }}"description": {{ . }},{{ end }}
{{ end -}}
{{ with .Params.tags -}}
"keywords": {{ . }},
"keywords": {{ delimit . " " }},
{{ end -}}
{{ else -}}
"@type": "WebPage",