mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 00:52:19 +01:00
layouts: Remove quoting of structured data
I don't understand it, but quoting these values causes Hugo to use escape codes for non-ASCII (?) characters. For example: "description": "A thriving oasis in Jordan\x27s desert is at risk of disappearing." Google's Search Console shows the following error: Unparsable structured data > Bad escape sequence in string We had a similar issue with dates that was fixed in #111 and the solution is the same here.
This commit is contained in:
parent
780444bfb0
commit
4a88be4434
@ -15,10 +15,10 @@
|
|||||||
"dateModified": {{ .Date.Format $ISO8601 }},
|
"dateModified": {{ .Date.Format $ISO8601 }},
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
|
{{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
|
||||||
"keywords": "{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}"
|
"keywords": {{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}
|
||||||
{{- with .Site.Params.description -}}
|
{{- with .Site.Params.description -}}
|
||||||
,
|
,
|
||||||
"description": "{{- . -}}"
|
"description": {{- . -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -38,12 +38,12 @@
|
|||||||
}
|
}
|
||||||
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
|
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
|
||||||
,
|
,
|
||||||
"keywords": "{{ delimit (union .Params.keywords (union .Params.categories .Params.tags)) ", " }}"
|
"keywords": {{ delimit (union .Params.keywords (union .Params.categories .Params.tags)) ", " }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- with .Params.description -}}
|
{{- with .Params.description -}}
|
||||||
,
|
,
|
||||||
"description": "{{ . }}"
|
"description": {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user