From cb69696416bdecfe8f14aeb35343ca841e8fbca2 Mon Sep 17 00:00:00 2001 From: paspo Date: Sat, 13 Jul 2024 18:19:41 +0000 Subject: [PATCH] fix dimensione immagine in single view (#94) fixes #93 #86 Reviewed-on: https://git.libreschool.org/BgLUG/bglug.it/pulls/94 Co-authored-by: paspo Co-committed-by: paspo --- layouts/_default/single.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 41914a6..945c758 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,23 +8,26 @@ {{ partial "tags.html" . }} - {{- if or .Params.image }} + {{- if or .Params.image .Params.featured }} - {{- $featimg := "#" -}} + {{- $maxHeight := 600 -}} + {{- $img := "#" -}} {{- if .Params.image -}} {{/* se è stata definita un'immagine featured */}} - {{- $img := .Page.Resources.GetMatch .Params.image -}} - {{- $featimg = $img.RelPermalink -}} + {{- $img = .Page.Resources.GetMatch .Params.image -}} {{- end -}} {{- if .Params.featured -}} {{/* se è stata definita un'immagine featured */}} - {{- $img := .Page.Resources.GetMatch .Params.featured -}} - {{- $featimg = $img.RelPermalink -}} + {{- $img = .Page.Resources.GetMatch .Params.featured -}} {{- end -}} + + {{- $image := $img.Resize (printf "x%d" $maxHeight) -}} - {{ .Params.image_alt }} + + {{ .Params.image_alt }} + {{ end }} {{- .Content }}