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