Fix json_ld output by removing quotes around params. Only hardcoded values neeed quotes.

This commit is contained in:
Fredrik Jonsson 2019-06-04 12:25:05 +02:00
commit 69b7a0bf75
2 changed files with 8 additions and 8 deletions

View file

@ -3,9 +3,9 @@
"@context": "http://schema.org", "@context": "http://schema.org",
"@type": "WebSite", "@type": "WebSite",
"url" : {{ .Permalink }}, "url" : {{ .Permalink }},
"name": "{{ .Title }}", "name": {{ .Title }},
{{ with $.Param "description" -}} {{ with $.Param "description" -}}
"description": "{{ . }}", "description": {{ . }},
{{ end -}} {{ end -}}
{{ with $.Param "image" -}} {{ with $.Param "image" -}}
"image" : {{ . | absURL }}, "image" : {{ . | absURL }},
@ -13,7 +13,7 @@
{{ with $.Param "author" -}} {{ with $.Param "author" -}}
"author": { "author": {
"@type": "Person", "@type": "Person",
"name": "{{ . }}" "name": {{ . }}
}, },
{{ end -}} {{ end -}}
"mainEntityOfPage": { "mainEntityOfPage": {
@ -22,7 +22,7 @@
}, },
"publisher": { "publisher": {
"@type": "Organization", "@type": "Organization",
"name": "{{ .Site.Title }}", "name": {{ .Site.Title }},
"url": {{ .Site.BaseURL }} "url": {{ .Site.BaseURL }}
} }
} }

View file

@ -2,11 +2,11 @@
{ {
"@context": "https://schema.org", "@context": "https://schema.org",
"@type": "BlogPosting", "@type": "BlogPosting",
"headline": "{{ .Title }}", "headline": {{ .Title }},
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }}, "datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}, "dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
"url" : {{ .Permalink }}, "url" : {{ .Permalink }},
"description": {{ with (.Description | default (replaceRE "\n" " " .Summary)) }}"{{ . }}"{{ end }}, "description": {{ with (.Description | default (replaceRE "\n" " " .Summary)) }}{{ . }}{{ end }},
{{ with $.Param "image" -}} {{ with $.Param "image" -}}
"image" : {{ . | absURL }}, "image" : {{ . | absURL }},
{{ end -}} {{ end -}}
@ -16,7 +16,7 @@
{{ with $.Param "author" -}} {{ with $.Param "author" -}}
"author": { "author": {
"@type": "Person", "@type": "Person",
"name": "{{ . }}" "name": {{ . }}
}, },
{{ end -}} {{ end -}}
"mainEntityOfPage": { "mainEntityOfPage": {
@ -25,7 +25,7 @@
}, },
"publisher": { "publisher": {
"@type": "Organization", "@type": "Organization",
"name": "{{ .Site.Title }}", "name": {{ .Site.Title }},
"url": {{ .Site.BaseURL }} "url": {{ .Site.BaseURL }}
} }
} }