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
1 changed files with 7 additions and 3 deletions

View File

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