diff options
Diffstat (limited to 'layouts/_partials/head/seo.html')
| -rw-r--r-- | layouts/_partials/head/seo.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/layouts/_partials/head/seo.html b/layouts/_partials/head/seo.html new file mode 100644 index 0000000..628ea2c --- /dev/null +++ b/layouts/_partials/head/seo.html @@ -0,0 +1,46 @@ +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "{{ if .IsPage }}Article{{ else }}WebSite{{ end }}", + "url": {{ .Permalink }}, + "name": {{ with .Title }}{{ . }}{{ else }}{{ site.Title }}{{ end }}, + "headline": {{ with .Title }}{{ . }}{{ else }}{{ site.Title }}{{ end }}, + "description": {{ with .Description }}{{ . }}{{ else }}{{ site.Params.description | default site.Title }}{{ end }}, + {{- with .Params.images }} + "image": [ + {{- range $i, $image := . }} + {{- if $i }},{{ end }} + "{{ $image | absURL }}" + {{- end }} + ], + {{- else }} + {{- with site.Params.logo }} + "image": ["{{ . | absURL }}"], + {{- end }} + {{- end }} + {{- if .IsPage }} + "datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}", + {{- with .Lastmod }} + "dateModified": "{{ .Format "2006-01-02T15:04:05Z07:00" }}", + {{- end }} + {{- end }} + "author": { + "@type": "Person", + "name": "{{ site.Params.author.name | default site.Title }}" + }, + "publisher": { + "@type": "Organization", + "name": "{{ site.Title }}" + {{- with site.Params.logo }}, + "logo": { + "@type": "ImageObject", + "url": "{{ . | absURL }}" + } + {{- end }} + }, + "mainEntityOfPage": { + "@type": "WebPage", + "@id": {{ .Permalink }} + } +} +</script> |
