Skip to content

Commit

Permalink
[seo] no escape url on JSON-LD
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoqing <xiaoqingnb@gmail.com>
  • Loading branch information
wu0407 committed Dec 3, 2023
1 parent 4b8667a commit 67e34ef
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
"url": {{ .Permalink }},
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
Expand All @@ -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 -}}
Expand All @@ -78,7 +78,7 @@
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
"@id": {{ .Permalink }}
},
{{- $images := $params.seo.images | default slice -}}
{{- if not $images -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
Expand All @@ -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 -}}
},
Expand Down

0 comments on commit 67e34ef

Please sign in to comment.