From dc07c8b01e8a6d3d4741bb5095ae1cf3ce4e5025 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Wed, 6 Jan 2021 10:22:44 +0100 Subject: [PATCH] Don't display the featured image if it's the same as configured --- layouts/partials/summary-with-image.html | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 layouts/partials/summary-with-image.html diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html new file mode 100644 index 0000000..79cde75 --- /dev/null +++ b/layouts/partials/summary-with-image.html @@ -0,0 +1,34 @@ +{{ $featured_image := partial "func/GetFeaturedImage.html" . }} +
+
+
+ {{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} + {{ $featured_image := (trim $featured_image "/") | absURL }} + {{/* Don't put the featured image in the summary if it's the default one */}} + {{ $default_image := (trim .Site.Params.featured_image "/") | relURL }} + {{ $current_image := $featured_image | relURL }} + {{ if not (eq $default_image $current_image) }} +
+ + image from {{ .Title }} + +
+ {{ end }} + {{ end }} +
+

+ + {{ .Title }} + +

+ + {{ $.Param "read_more_copy" | default (i18n "readMore") }} + {{/* TODO: add author +

By {{ .Author }}

*/}} +
+
+
+