Skip to content

Commit

Permalink
Fix issue in structured data with escape characters in output, add fa…
Browse files Browse the repository at this point in the history
…llback for WebPage to site title and description
  • Loading branch information
wjh18 committed May 24, 2022
1 parent 15b6f06 commit d2e7a0c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions layouts/partials/head/seo/structured-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@type": "WebSite",
"@id": {{ print $baseURL "#/schema/website/1" }},
"url": {{ print $baseURL }},
"name": "{{ .Site.Title }}",
"description": "{{ .Site.Params.description }}",
"name": {{ .Site.Title }},
"description": {{ .Site.Params.description }},
"publisher": {
"@id": {{ print $baseURL "#/schema/person/1" }}
}
Expand All @@ -52,8 +52,8 @@
{{ end -}}
"@id": {{ .Permalink }},
"url": {{ .Permalink }},
"name": "{{ .Title }}",
"description": "{{ .Description }}",
"name": {{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }},
"description": {{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }},
"isPartOf": {
"@id": {{ print $baseURL "#/schema/website/1" }}
},
Expand All @@ -68,7 +68,7 @@
"primaryImageOfPage": {
"@id": {{ print .Permalink "#/schema/image/2" }}
},
"inLanguage": "{{ .Site.Params.schemaLocale }}",
"inLanguage": {{ .Site.Params.schemaLocale }},
"potentialAction": [{
"@type": "ReadAction", "target": [{{ .Permalink }}]
}]
Expand All @@ -85,7 +85,7 @@
"@type": "WebPage",
"@id": {{ .url }},
"url": {{ .url }},
"name": "{{ .name | humanize | title }}"
"name": {{ .name | humanize | title }}
{{ else -}}
"@id": {{ .url }}
{{ end -}}
Expand All @@ -100,8 +100,8 @@
{
"@type": "Article",
"@id": {{ print $baseURL "#/schema/article/1" }},
"headline": "{{ .Title }}",
"description": "{{ .Description }}",
"headline": {{ .Title }},
"description": {{ .Description }},
"isPartOf": {
"@id": {{ .Permalink }}
},
Expand Down Expand Up @@ -131,7 +131,7 @@
"@id": {{ print .Permalink "#/schema/image/2" }},
"url": {{ $.Scratch.Get "primaryImage" }},
"contentUrl": {{ $.Scratch.Get "primaryImage" }},
"caption": "{{ .Title }}"
"caption": {{ .Title }}
}
]
}
Expand Down

0 comments on commit d2e7a0c

Please sign in to comment.