From 0f875ea65400b99beb1b141f27d0088ab246e566 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 7 Jul 2024 00:15:38 +0200 Subject: [PATCH] fix immagini mancanti --- layouts/_default/shortblock.html | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 layouts/_default/shortblock.html diff --git a/layouts/_default/shortblock.html b/layouts/_default/shortblock.html new file mode 100644 index 0000000..2079953 --- /dev/null +++ b/layouts/_default/shortblock.html @@ -0,0 +1,40 @@ +
+
+ + {{/* di default, niente immagine */}} + {{- $featimg := "#" -}} + + {{- if .Params.image -}} + {{/* se è stata definita un'immagine featured */}} + {{- $img := .Page.Resources.GetMatch .Params.image -}} + {{- $featimg = $img.RelPermalink -}} + {{- else -}} + {{- if .Params.featured -}} + {{/* se è stata definita un'immagine featured */}} + {{- $img := .Page.Resources.GetMatch .Params.featured -}} + {{- $featimg = $img.RelPermalink -}} + {{- else -}} + {{/* altrimenti prendo la prima risorsa immagine disponibile */}} + {{- $img := (.Page.Resources.ByType "image").GetMatch "**" -}} + {{- if $img -}} + {{- $featimg = $img.RelPermalink -}} + {{- end -}} + {{- end -}} + {{- end -}} + + {{ .Params.image_alt }} +
+

{{ .Title }}

+ {{ if .Site.Params.show_post_dates | default true }} + {{- with .Date }}{{ end }} + {{ end }} +

+ {{ with .Description }} + {{- . }} + {{- else }} + {{- .Summary }} + {{- end }} +

+
+
+