Minor codestyle fixes to meta_breadcrumb. Moving safeJS to the partial output.
This commit is contained in:
parent
a4b9df99b1
commit
86d7c8d001
1 changed files with 25 additions and 28 deletions
|
|
@ -1,17 +1,14 @@
|
|||
<script type="application/ld+json">
|
||||
{{- $blogSections := site.Params.blogSections | default (slice "blog" "post") }}
|
||||
{{- $breadcrumbSections := site.Params.breadcrumbSections | default (slice) }}
|
||||
{{ $blogSections := site.Params.blogSections | default (slice "blog" "post") -}}
|
||||
{{ $breadcrumbSections := site.Params.breadcrumbSections | default (slice) -}}
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
{{ if .IsPage -}}
|
||||
"@type": {{ if in $blogSections .Section -}}
|
||||
"BlogPosting",
|
||||
{{- else -}}
|
||||
"WebPage",
|
||||
{{- if in $breadcrumbSections .Section }}
|
||||
"breadcrumb": {{ safeJS (partial "meta_breadcrumb_json_ld.html" .) }},
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
"@type": {{ if in $blogSections .Section }}"BlogPosting",{{ else }}"WebPage",
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
"headline": {{ .Title }},
|
||||
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
|
|
@ -24,9 +21,9 @@
|
|||
{{ end -}}
|
||||
{{ else -}}
|
||||
"@type": "WebPage",
|
||||
{{- if in $breadcrumbSections .Section }}
|
||||
"breadcrumb": {{ safeJS (partial "meta_breadcrumb_json_ld.html" .) }},
|
||||
{{- end }}
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
"url" : {{ .Permalink }},
|
||||
"name": {{ .Title }},
|
||||
{{ with $.Param "description" -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue