diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 589316a..a496b45 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,6 +2,10 @@ {{- partial "section_meta.html" . -}} {{ end }} +{{ define "header" }} +{{- partial "section_json_ld.html" . -}} +{{ end }} + {{ define "main" -}}

{{ .Title }}

diff --git a/layouts/index.html b/layouts/index.html index 516af84..7d22f69 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,6 +5,10 @@ {{- partial "single_meta.html" . -}} {{ end }} +{{ define "header" }} +{{- partial "section_json_ld.html" . -}} +{{ end }} + {{ define "main" -}}
diff --git a/layouts/partials/section_json_ld.html b/layouts/partials/section_json_ld.html new file mode 100755 index 0000000..fc445eb --- /dev/null +++ b/layouts/partials/section_json_ld.html @@ -0,0 +1,26 @@ + diff --git a/layouts/partials/single_json_ld.html b/layouts/partials/single_json_ld.html index 1982c15..1f70b5f 100755 --- a/layouts/partials/single_json_ld.html +++ b/layouts/partials/single_json_ld.html @@ -6,14 +6,17 @@ "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 }}, + "description": {{ with (replaceRE "\n" " " (.Description | default .Summary)) }}{{ . | jsonify }}{{ end }}, + {{ with $.Param "image" -}} + "image" : "{{ . | absURL }}", + {{ end -}} {{ with .Params.tags -}} "keywords": {{ . | jsonify }}, {{ end -}} {{ with $.Param "author" -}} "author": { "@type": "Person", - "name": "{{ . }}" + "name": {{ . | jsonify }} }, {{ end -}} "mainEntityOfPage": { @@ -22,7 +25,7 @@ }, "publisher": { "@type": "Organization", - "name": "{{ .Site.Title }}", + "name": {{ .Site.Title | jsonify }}, "url": "{{ .Site.BaseURL }}", } }