mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 00:52:19 +01:00
layouts: Fix more structured data escaping issues
I think we actually only need to quote string literals. Otherwise, it seems that Hugo automatically adds quoting for us, and doesn't use funny escaping of URLs, special characters, etc.
This commit is contained in:
parent
9e0b00038a
commit
85abd20ba7
@ -4,11 +4,11 @@
|
|||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
"@type": "Blog",
|
"@type": "Blog",
|
||||||
{{- /* Google recommends the headline be no more than 110 characters */}}
|
{{- /* Google recommends the headline be no more than 110 characters */}}
|
||||||
"headline": "{{ substr .Site.Title 0 110 }}",
|
"headline": {{ substr .Site.Title 0 110 }},
|
||||||
"url" : "{{ printf "%s" .Permalink }}",
|
"url" : {{ printf "%s" .Permalink }},
|
||||||
"author": {
|
"author": {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": "{{ .Site.Params.author }}"
|
"name": {{ .Site.Params.author }}
|
||||||
},
|
},
|
||||||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||||
{{- if not .Date.IsZero }}
|
{{- if not .Date.IsZero }}
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
"@type": "BlogPosting",
|
"@type": "BlogPosting",
|
||||||
{{- /* Google recommends the headline be no more than 110 characters */}}
|
{{- /* Google recommends the headline be no more than 110 characters */}}
|
||||||
"headline": "{{ substr .Title 0 110 }}",
|
"headline": {{ substr .Title 0 110 }},
|
||||||
{{- with .Params.images -}}{{ range first 1 . }}
|
{{- with .Params.images -}}{{ range first 1 . }}
|
||||||
"image": {
|
"image": {
|
||||||
"@type": "ImageObject",
|
"@type": "ImageObject",
|
||||||
"url": "{{ . | absURL }}"
|
"url": {{ . | absURL }}
|
||||||
{{- /* Don't try to get imageConfig if image param is not local */ -}}
|
{{- /* Don't try to get imageConfig if image param is not local */ -}}
|
||||||
{{- if not (or (hasPrefix . "http://") (hasPrefix . "https://")) -}}
|
{{- if not (or (hasPrefix . "http://") (hasPrefix . "https://")) -}}
|
||||||
{{- with (imageConfig (printf "/static/%s" .)) -}}
|
{{- with (imageConfig (printf "/static/%s" .)) -}}
|
||||||
@ -21,7 +21,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
},
|
},
|
||||||
{{- end -}}{{ end }}
|
{{- end -}}{{ end }}
|
||||||
"url": "{{ printf "%s" .Permalink }}",
|
"url": {{ printf "%s" .Permalink }},
|
||||||
"wordCount": "{{ .WordCount }}",
|
"wordCount": "{{ .WordCount }}",
|
||||||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||||
{{- if not .PublishDate.IsZero }}
|
{{- if not .PublishDate.IsZero }}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
"author": {
|
"author": {
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"name": "{{ .Params.author | default .Site.Params.author }}"
|
"name": {{ .Params.author | default .Site.Params.author }}
|
||||||
}
|
}
|
||||||
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
|
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
|
||||||
,
|
,
|
||||||
|
Loading…
Reference in New Issue
Block a user