diff options
Diffstat (limited to 'layouts/partials/seo_schema.html')
-rw-r--r-- | layouts/partials/seo_schema.html | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/layouts/partials/seo_schema.html b/layouts/partials/seo_schema.html new file mode 100644 index 0000000..dc2f7f9 --- /dev/null +++ b/layouts/partials/seo_schema.html @@ -0,0 +1,57 @@ +<!-- Schema.org for Google --> +<meta itemprop="name" content="{{ .Title }}"> +<meta itemprop="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}"> +<!-- Open Graph general (Facebook, Pinterest & Google+) --> +<meta name="og:title" content="{{ .Title }}"> +<meta name="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}"> +<meta name="og:type" content="article"> +<!-- Twitter --> +<meta name="twitter:card" content="summary"> +<meta name="twitter:title" content="{{ .Title }}"> +<meta name="twitter:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}"> +<!-- Open Graph - Article --> +<meta name="article:author" content="{{ .Site.Data.config.author }}"> + +<!-- JSON-LD --> +{{ if .IsHome }} +<script type="application/ld+json"> +{ + "@context": "http://schema.org", + "@type": "WebSite", + "url": "{{ .Permalink }}", + "name": "{{ .Site.Title }}", + "author": { + "@type": "Person", + "name": "{{ .Site.Data.config.author }}" + }, + "description": "{{ .Site.Data.config.description }}", +} +</script> +{{ end }} +{{ if .IsPage }} +<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" : "{{ .Site.LanguageCode }}", + "author" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}", + "creator" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}", + "publisher": "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}", + "accountablePerson" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}", + "copyrightHolder" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}", + "copyrightYear" : "{{ .Date.Format "2006" }}", + "datePublished": "{{ .Date }}", + "dateModified" : "{{ .Date }}", + "url" : "{{ .Permalink }}", + "wordCount" : "{{ .WordCount }}", + "keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }} {{with .Site.Title}}"{{ .}}"{{ end }}] +} +</script> +{{ end }}
\ No newline at end of file |