diff --git a/layouts/partials/images/functions/page-thumbnail-resource.html b/layouts/partials/images/functions/page-thumbnail-resource.html deleted file mode 100644 index 2f96915..0000000 --- a/layouts/partials/images/functions/page-thumbnail-resource.html +++ /dev/null @@ -1,6 +0,0 @@ -{{- $img := partialCached "images/functions/page-featured-image-resource" . . }} -{{- if not $img }} - {{- $images := partialCached "images/functions/page-image-resources" . . }} - {{- $img = $images.GetMatch "{*cover*,*thumbnail*}" -}} -{{- end }} -{{- return $img -}} diff --git a/layouts/partials/images/functions/page-thumbnail.html b/layouts/partials/images/functions/page-thumbnail.html index 8671b0c..5144c29 100644 --- a/layouts/partials/images/functions/page-thumbnail.html +++ b/layouts/partials/images/functions/page-thumbnail.html @@ -1,17 +1,14 @@ -{{- $img := "" }} {{- $page := .Page }} -{{- with $page.Params.images }} - {{- $img = index . 0 }} -{{- else }} - {{- $thumbnail := partialCached "images/functions/page-thumbnail-resource" $page $page }} - {{- with $thumbnail }} - {{- $img = replace .RelPermalink $page.RelPermalink "" | printf "%s?height=360px" }} - {{- end }} -{{- end }} +{{- $images := partial "_funcs/get-page-images" $page }} {{- $html := "" }} -{{- with $img }} +{{- with $images }} + {{- $image := index . 0 }} + {{- $filename := $image.RelPermalink }} + {{- if $image.Image }} + {{- $filename = $image.Image.Name }} + {{- end }} {{- $html = partial "images/image" (dict - "Filename" $img + "Filename" $filename "Page" $page "Style" $.Style "ClassName" $.ClassName)