Only add published date to seo_schema if set

This commit is contained in:
BBaoVanC 2021-11-20 17:09:21 -06:00
parent f5c9e6926a
commit 0893c99f97
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -40,9 +40,13 @@
"image": "{{ .Permalink }}", "image": "{{ .Permalink }}",
{{ end }} {{ end }}
"copyrightYear" : "{{ .Date.Format "2006" }}", {{ with .Date -}}
"datePublished": "{{ .Date | safeHTML }}", "copyrightYear" : "{{ .Format "2006" }}",
"dateModified" : "{{ .Lastmod | safeHTML }}", "datePublished": "{{ . | safeHTML }}",
{{ end }}
{{ with .Lastmod }}
"dateModified" : "{{ . | safeHTML }}",
{{ end }}
"url" : "{{ .Permalink }}", "url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}", "wordCount" : "{{ .WordCount }}",
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }} "Blog" ] "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }} "Blog" ]