LoveIt/layouts/partials/head/seo.html

108 lines
3.5 KiB
HTML
Raw Normal View History

{{- with .Site.Params.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.bing -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.yandex -}}
<meta name="yandex-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.pinterest -}}
<meta name="p:domain_verify" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.baidu -}}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{- /* Home SEO */ -}}
2020-01-31 15:53:04 +01:00
{{- if .IsHome -}}
2019-08-09 15:25:13 +02:00
<script type="application/ld+json">
{
2020-01-31 15:53:04 +01:00
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
2020-01-31 15:53:04 +01:00
{{- with .Site.Author.name -}}
"author": {
"@type": "Person",
"name": "{{ . | safeJS }}"
2020-01-31 15:53:04 +01:00
},
{{- end -}}
{{- with .Site.Params.description -}}
"description": "{{ . | safeJS }}",
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- with .Site.Params.image -}}
"image": "{{ .url | absURL }}",
{{- end -}}
{{- with .Site.Params.logo -}}
"thumbnailUrl": "{{ .url | absURL }}",
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeJS }}",
2020-01-31 15:53:04 +01:00
{{- end -}}
"name": "{{ .Site.Title | safeJS }}"
2019-02-03 12:30:44 +01:00
}
2019-08-09 15:25:13 +02:00
</script>
{{- /* Page SEO */ -}}
{{- else if .IsPage -}}
2019-08-09 15:25:13 +02:00
<script type="application/ld+json">
{
2020-01-31 15:53:04 +01:00
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "{{ .Title | safeJS }}",
"inLanguage": "{{ .Site.LanguageCode }}",
2020-01-31 15:53:04 +01:00
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
2019-08-09 15:25:13 +02:00
},
{{- if ge .Site.Params.image.width 696 -}}
2020-01-31 15:53:04 +01:00
"image": {
"@type": "ImageObject",
"url": "{{ .Site.Params.image.url | absURL }}",
"width": {{ .Site.Params.image.width }},
"height": {{ .Site.Params.image.height }}
},
{{- end -}}
"genre": "{{ .Type }}",
{{- with .Params.tags -}}
"keywords": "{{ delimit . ", " }}",
{{- end -}}
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": "{{ .PublishDate.Format "2006-01-02" }}",
2020-01-31 15:53:04 +01:00
{{- else if not .Date.IsZero -}}
"datePublished": "{{ .Date.Format "2006-01-02" }}",
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- with .Lastmod -}}
"dateModified": "{{ .Format "2006-01-02" }}",
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeJS }}",
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- with .Site.Params.publisher -}}
"publisher": {
"@type": "Organization",
"name": "{{ .name | safeJS }}",
2020-01-31 15:53:04 +01:00
"logo": {
"@type": "ImageObject",
"url": "{{ .logo.url | absURL }}",
"width": {{ .logo.width }},
"height": {{ .logo.height }}
}
},
{{- end -}}
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
2020-01-31 15:53:04 +01:00
"author": {
"@type": "Person",
"name": "{{ . | safeJS }}"
2020-01-31 15:53:04 +01:00
},
{{- end -}}
"description": "{{ .Description | safeJS }}"
2019-08-09 15:25:13 +02:00
}
</script>
2020-02-06 17:10:00 +01:00
{{- end -}}