mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2025-05-10 22:46:02 +02:00
Clean up empty whitespace in JSON-LD
Use secret formatting feature of Go templates, adding - to blocks to clear whitespace around the tags.
This commit is contained in:
@ -3,26 +3,26 @@
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@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 }}",
|
||||
"url" : "{{ printf "%s" .Permalink }}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Params.author }}"
|
||||
},
|
||||
{{ $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||
{{ if not .Date.IsZero }}
|
||||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||
{{- if not .Date.IsZero }}
|
||||
"dateModified": "{{ .Date.Format $ISO8601 }}",
|
||||
{{ end }}
|
||||
{{ with .Site.Social.GooglePlus }}
|
||||
{{- end }}
|
||||
{{- with .Site.Social.GooglePlus }}
|
||||
"publisher": "{{ printf "%s" . }}",
|
||||
{{ end }}
|
||||
{{/* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
|
||||
{{- end }}
|
||||
{{- /* 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 }}"
|
||||
{{ with .Site.Params.description }}
|
||||
{{- with .Site.Params.description -}}
|
||||
,
|
||||
"description": "{{- . -}}"
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user