fix dimensione immagine in single view #94

Merged
paspo merged 1 commits from paspo/bglug.it:fix-singleview into main 2024-07-13 18:19:42 +00:00
Showing only changes of commit d71336d2e5 - Show all commits

View File

@ -8,23 +8,26 @@
{{ partial "tags.html" . }} {{ partial "tags.html" . }}
</header> </header>
{{- if or .Params.image }} {{- if or .Params.image .Params.featured }}
{{- $featimg := "#" -}} {{- $maxHeight := 600 -}}
{{- $img := "#" -}}
{{- if .Params.image -}} {{- if .Params.image -}}
{{/* se è stata definita un'immagine featured */}} {{/* se è stata definita un'immagine featured */}}
{{- $img := .Page.Resources.GetMatch .Params.image -}} {{- $img = .Page.Resources.GetMatch .Params.image -}}
{{- $featimg = $img.RelPermalink -}}
{{- end -}} {{- end -}}
{{- if .Params.featured -}} {{- if .Params.featured -}}
{{/* se è stata definita un'immagine featured */}} {{/* se è stata definita un'immagine featured */}}
{{- $img := .Page.Resources.GetMatch .Params.featured -}} {{- $img = .Page.Resources.GetMatch .Params.featured -}}
{{- $featimg = $img.RelPermalink -}}
{{- end -}} {{- end -}}
<span class="image featured"><img src="{{ $featimg }}" alt="{{ .Params.image_alt }}" /></span> {{- $image := $img.Resize (printf "x%d" $maxHeight) -}}
<span class="image featured">
<img src="{{ $image.RelPermalink }}" alt="{{ .Params.image_alt }}" style="width: {{ $image.Width }}px; max-height: {{ $maxHeight }}px;" />
</span>
{{ end }} {{ end }}
{{- .Content }} {{- .Content }}