From 69b7a0bf75796f6acc58a59392c0c23504b5005e Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Tue, 4 Jun 2019 12:25:05 +0200 Subject: [PATCH] Fix json_ld output by removing quotes around params. Only hardcoded values neeed quotes. --- layouts/partials/section_json_ld.html | 8 ++++---- layouts/partials/single_json_ld.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/partials/section_json_ld.html b/layouts/partials/section_json_ld.html index 6f9d925..559da9e 100644 --- a/layouts/partials/section_json_ld.html +++ b/layouts/partials/section_json_ld.html @@ -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 }} } } diff --git a/layouts/partials/single_json_ld.html b/layouts/partials/single_json_ld.html index 86e562b..7951629 100644 --- a/layouts/partials/single_json_ld.html +++ b/layouts/partials/single_json_ld.html @@ -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 }} } }