From a6d3e86f66bc52defb24712cf0b75d53f34d652c Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Tue, 21 Feb 2023 10:54:33 +0100 Subject: [PATCH] handle default image --- config.yaml | 1 + layouts/partials/posts/post.html | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config.yaml b/config.yaml index df6cc141..c634a5e6 100644 --- a/config.yaml +++ b/config.yaml @@ -7,6 +7,7 @@ params: breadcrumb: position: hero-start # hero-start | hero-end | after-hero posts: + default_image: false index: show_categories: false show_author: false diff --git a/layouts/partials/posts/post.html b/layouts/partials/posts/post.html index 6430cdc4..df3fbd9a 100644 --- a/layouts/partials/posts/post.html +++ b/layouts/partials/posts/post.html @@ -38,16 +38,18 @@ </div> - <div class="media"> - {{- if .Params.image -}} + {{- if .Params.image -}} + <div class="media"> {{- partial "commons/image.html" (dict "image" .Params.image "sizes" site.Params.image_sizes.sections.posts.item ) -}} - {{- else -}} + </div> + {{- else if site.Params.posts.default_image -}} + <div class="media"> {{- partial "commons/image-default.html" -}} - {{- end -}} - </div> + </div> + {{- end -}} </article> {{ end }} \ No newline at end of file -- GitLab