From 67e34ef18b5579822b799d83385ea66183b09ac7 Mon Sep 17 00:00:00 2001 From: xiaoqing Date: Sun, 3 Dec 2023 23:03:19 +0800 Subject: [PATCH] [seo] no escape url on JSON-LD Signed-off-by: xiaoqing --- layouts/partials/head/seo.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index d41d6527d..9d406c17d 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -28,7 +28,7 @@ { "@context": "http://schema.org", "@type": "WebSite", - "url": "{{ .Permalink }}", + "url": {{ .Permalink }}, {{- with .Site.LanguageCode -}} "inLanguage": "{{ . }}", {{- end -}} @@ -45,20 +45,20 @@ {{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" -}} "image": { "@type": "ImageObject", - "url": "{{ .Permalink }}", + "url": {{ .Permalink }}, "width": {{ .Width }}, "height": {{ .Height }} }, {{- else -}} {{- with $image -}} - "image": "{{ . | absURL }}", + "image": {{ . | absURL }}, {{- end -}} {{- end -}} {{- with .Site.Params.seo.thumbnailUrl -}} {{- with dict "Path" . "Resources" $.Resources | partial "function/resource.html" -}} - "thumbnailUrl": "{{ .Permalink }}", + "thumbnailUrl": {{ .Permalink }}, {{- else -}} - "thumbnailUrl": "{{ . | absURL }}", + "thumbnailUrl": {{ . | absURL }}, {{- end -}} {{- end -}} {{- with .Site.Copyright -}} @@ -78,7 +78,7 @@ "inLanguage": "{{ .Site.LanguageCode }}", "mainEntityOfPage": { "@type": "WebPage", - "@id": "{{ .Permalink }}" + "@id": {{ .Permalink }} }, {{- $images := $params.seo.images | default slice -}} {{- if not $images -}} @@ -99,13 +99,13 @@ {{- with dict "Path" $value "Resources" $.Resources | partial "function/resource.html" -}} { "@type": "ImageObject", - "url": "{{ .Permalink }}", + "url": {{ .Permalink }}, "width": {{ .Width }}, "height": {{ .Height }} } {{- else -}} {{- with $value -}} - "{{ . | absURL }}" + {{ . | absURL }} {{- end -}} {{- end -}} {{- end -}} @@ -116,7 +116,7 @@ "keywords": "{{ delimit . ", " }}", {{- end -}} "wordcount": {{ .WordCount }}, - "url": "{{ .Permalink }}", + "url": {{ .Permalink }}, {{- if not .PublishDate.IsZero -}} "datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}, {{- else if not .Date.IsZero -}} @@ -137,13 +137,13 @@ {{- with dict "Path" $logo "Resources" .Resources | partial "function/resource.html" -}} ,"logo": { "@type": "ImageObject", - "url": "{{ .Permalink }}", + "url": {{ .Permalink }}, "width": {{ .Width }}, "height": {{ .Height }} } {{- else -}} {{- with $logo -}} - ,"logo": "{{ . | absURL }}" + ,"logo": {{ . | absURL }} {{- end -}} {{- end -}} },