hugo-PaperMod
hugo-PaperMod copied to clipboard
schemajson breadcrumb breaks minify when baseURL=/
trafficstars
Hi,
When building the site with minify=true and base-url=/ the schema json miss a comma.
This did not happened when base-url has more than 1 slash.
Several tickets were opened around that.
It is at https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/partials/templates/schema_json.html#L48
A fix is to declare an consume a bool instead of trying to count the number of slash.
like in
"itemListElement": [
{{- $zzz := false -}}
{{- range $index, $element := $bc_list }}
{{- $zzz = true -}}
...
{{- end }}
{{- end }}
{{- /* self-page addition */ -}}
{{- if $zzz }}, {{end }}
+1
baseURL should be properly configured. Avoid setting it as /
https://gohugo.io/getting-started/configuration/#baseurl