diff --git a/layouts/partials/components/json-ld.html b/layouts/partials/components/json-ld.html index 27535738..fee1b849 100644 --- a/layouts/partials/components/json-ld.html +++ b/layouts/partials/components/json-ld.html @@ -14,14 +14,14 @@ {{- end -}} {{- $imgsURL := ($Deliver.Scratch.Get "imgsURL") -}} -{{ with $Deliver.Params.images | default $imgsURL -}} - {{- $Deliver.Scratch.Delete "image" -}} +{{- with $Deliver.Params.images | default $imgsURL -}} + {{- $Deliver.Scratch.Delete "images" -}} {{- range . -}} {{- $image := . | absURL | safeHTML -}} - {{- $Deliver.Scratch.Add "image" (printf "%s, " $image) -}} + {{- $Deliver.Scratch.Add "images" (slice $image) -}} {{- end -}} -{{ end }} -{{- $image := (split (strings.TrimSuffix ", " ($Deliver.Scratch.Get "image")) ", ") -}} +{{- end -}} +{{- $images := $Deliver.Scratch.Get "images" -}} {{- partial "components/author.html" $Deliver -}} {{- $author := ($Deliver.Scratch.Get "author") -}} @@ -83,8 +83,8 @@ "inLanguage" : "{{ $Deliver.Site.LanguageCode }}", "articleSection": {{ $Deliver.Section }}, "wordCount": {{ $Deliver.WordCount }}, - {{ with $Deliver.Params.images | default $imgsURL -}} - "image": {{ $image }}, + {{ with $images -}} + "image": {{ . }}, {{ else -}} {{ with $Deliver.Site.Params.siteLogo -}} "image": {{ . | absURL }}, diff --git a/layouts/partials/components/open-graph.html b/layouts/partials/components/open-graph.html index 1545f1c3..28a67a5f 100644 --- a/layouts/partials/components/open-graph.html +++ b/layouts/partials/components/open-graph.html @@ -15,14 +15,14 @@ {{- end -}} {{- $imgsURL := ($Deliver.Scratch.Get "imgsURL") -}} -{{ with $Deliver.Params.images | default $imgsURL -}} - {{- $Deliver.Scratch.Delete "image" -}} +{{- with $Deliver.Params.images | default $imgsURL -}} + {{- $Deliver.Scratch.Delete "images" -}} {{- range . -}} {{- $image := . | absURL | safeHTML -}} - {{- $Deliver.Scratch.Add "image" (printf "%s, " $image) -}} + {{- $Deliver.Scratch.Add "images" (slice $image) -}} {{- end -}} -{{ end }} -{{- $image := (split (strings.TrimSuffix ", " ($Deliver.Scratch.Get "image")) ", ") -}} +{{- end -}} +{{- $images := $Deliver.Scratch.Get "images" -}} {{- partial "components/date.html" $Deliver -}} {{- $pubDate := ($Deliver.Scratch.Get "pubDate") -}} @@ -56,8 +56,8 @@ {{- end -}} {{- end -}} -{{- with $imgsURL -}} - +{{- with $images -}} + {{ else -}} {{ with $Deliver.Site.Params.siteLogo -}}