From 445f4f1a94f91ee7b0448313a69a2511415de5a0 Mon Sep 17 00:00:00 2001 From: Olivia206 <olivia.simonet206@gmail.com> Date: Fri, 22 Dec 2023 12:43:55 +0100 Subject: [PATCH] changed default image for large post --- layouts/partials/blocks/templates/posts/large.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/layouts/partials/blocks/templates/posts/large.html b/layouts/partials/blocks/templates/posts/large.html index 00595f82..78af84e2 100644 --- a/layouts/partials/blocks/templates/posts/large.html +++ b/layouts/partials/blocks/templates/posts/large.html @@ -50,14 +50,19 @@ </div> <div class="media"> + {{ $post_image := "" }} {{- if .Params.image -}} + {{ $post_image = .Params.image }} + {{- else if site.Params.posts.default_image -}} + {{ $post_image = site.Data.website.default_image }} + {{ end }} + + {{- if or .Params.image site.Params.posts.default_image -}} {{- partial "commons/image.html" (dict - "image" .Params.image + "image" $post_image "sizes" site.Params.image_sizes.sections.posts.item ) -}} - {{- else if site.Params.posts.default_image -}} - {{- partial "commons/image-default.html" -}} {{- end -}} </div> </article> -- GitLab