Added json-ld and fixes to meta tags.
This commit is contained in:
parent
ba7fac2547
commit
fb2dcc80cb
5 changed files with 35 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
{{ block "meta" . }}{{ end }}
|
{{ block "meta" . }}{{ end }}
|
||||||
{{- partial "meta.html" . -}}
|
{{- partial "meta.html" . -}}
|
||||||
{{- partialCached "meta_cache.html" . -}}
|
{{- partialCached "meta_cache.html" . -}}
|
||||||
|
{{ block "header" . }}{{ end }}
|
||||||
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}}
|
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
{{- partial "single_meta.html" . -}}
|
{{- partial "single_meta.html" . -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ define "header" }}
|
||||||
|
{{- partial "single_json_ld.html" . -}}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ define "main" -}}
|
{{ define "main" -}}
|
||||||
<main class="main layout__main" role="main">
|
<main class="main layout__main" role="main">
|
||||||
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}">{{ .Title }}</h1>
|
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}">{{ .Title }}</h1>
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,3 @@
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
|
||||||
29
layouts/partials/single_json_ld.html
Executable file
29
layouts/partials/single_json_ld.html
Executable file
|
|
@ -0,0 +1,29 @@
|
||||||
|
<script type="application/ld+json">
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "BlogPosting",
|
||||||
|
"headline": {{ .Title | jsonify }},
|
||||||
|
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}",
|
||||||
|
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}",
|
||||||
|
"url" : "{{ .Permalink }}",
|
||||||
|
"description": {{ with (replaceRE "\n" "" (.Description | default .Summary)) }}{{ . | jsonify }}{{ end }},
|
||||||
|
{{ with .Params.tags -}}
|
||||||
|
"keywords": {{ . | jsonify }},
|
||||||
|
{{ end -}}
|
||||||
|
{{ with $.Param "author" -}}
|
||||||
|
"author": {
|
||||||
|
"@type": "Person",
|
||||||
|
"name": "{{ . }}"
|
||||||
|
},
|
||||||
|
{{ end -}}
|
||||||
|
"mainEntityOfPage": {
|
||||||
|
"@type": "WebPage",
|
||||||
|
"@id": "{{ .Site.BaseURL }}"
|
||||||
|
},
|
||||||
|
"publisher": {
|
||||||
|
"@type": "Organization",
|
||||||
|
"name": "{{ .Site.Title }}",
|
||||||
|
"url": "{{ .Site.BaseURL }}",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
<meta name="description" content="{{ replaceRE "\n" "" (.Description | default .Summary) }}">
|
<meta name="description" content="{{ replaceRE "\n" "" (.Description | default .Summary) }}">
|
||||||
<meta name="created" content="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">
|
<meta name="created" content="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">
|
||||||
|
<meta name="modified" content="{{ .Lastmod.Format "2006-01-02T15:04:05-0700" }}">
|
||||||
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
|
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue