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",
"@type": "WebSite",
"url" : {{ .Permalink }},
"name": "{{ .Title }}",
"name": {{ .Title }},
{{ with $.Param "description" -}}
"description": "{{ . }}",
"description": {{ . }},
{{ end -}}
{{ with $.Param "image" -}}
"image" : {{ . | absURL }},
@ -13,7 +13,7 @@
{{ with $.Param "author" -}}
"author": {
"@type": "Person",
"name": "{{ . }}"
"name": {{ . }}
},
{{ end -}}
"mainEntityOfPage": {
@ -22,7 +22,7 @@
},
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Title }}",
"name": {{ .Site.Title }},
"url": {{ .Site.BaseURL }}
}
}

View file

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