diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/header.html | 1 | ||||
-rw-r--r-- | layouts/partials/seo_schema.html | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 03d8096..b954fe9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,6 +6,7 @@ --> <html> <head> + {{ partial "seo_schema" . }} {{ with $.Scratch.Get "generalTitle" }} <title>{{ . }}</title> {{ else }} diff --git a/layouts/partials/seo_schema.html b/layouts/partials/seo_schema.html new file mode 100644 index 0000000..a30598d --- /dev/null +++ b/layouts/partials/seo_schema.html @@ -0,0 +1,26 @@ +<script type="application/ld+json"> + { + "@context" : "http://schema.org", + "@type" : "BlogPosting", + "mainEntityOfPage": { + "@type": "WebPage", + "@id": "{{ .Site.BaseURL }}" + }, + "articleSection" : "{{ .Section }}", + "name" : "{{ .Title }}", + "headline" : "{{ .Title }}", + "description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}", + "inLanguage" : "{{ .Lang }}", + "author" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "creator" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "publisher": "{{ range .Site.Author }}{{ . }}{{ end }}", + "accountablePerson" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "copyrightHolder" : "{{ range .Site.Author }}{{ . }}{{ end }}", + "copyrightYear" : "{{ .Date.Format "2006" }}", + "datePublished": "{{ .Date }}", + "dateModified" : "{{ .Date }}", + "url" : "{{ .Permalink }}", + "wordCount" : "{{ .WordCount }}", + "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }}"Blog" ] + } + </script>
\ No newline at end of file |