fix featured image

This commit is contained in:
Paolo Asperti 2024-07-07 08:16:16 +02:00
parent 0f875ea654
commit 4cbce336b8
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -0,0 +1,31 @@
{{ define "main" }}
<header>
<h2>{{ .Title }}</h2>
<p>{{ .Description }}</p>
{{ if .Site.Params.show_post_dates | default true }}
{{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }}
{{ end }}
{{ partial "tags.html" . }}
</header>
{{- if or .Params.image }}
{{- $featimg := "#" -}}
{{- if .Params.image -}}
{{/* se è stata definita un'immagine featured */}}
{{- $img := .Page.Resources.GetMatch .Params.image -}}
{{- $featimg = $img.RelPermalink -}}
{{- end -}}
{{- if .Params.featured -}}
{{/* se è stata definita un'immagine featured */}}
{{- $img := .Page.Resources.GetMatch .Params.featured -}}
{{- $featimg = $img.RelPermalink -}}
{{- end -}}
<span class="image featured poppo"><img src="{{ $featimg }}" alt="{{ .Params.image_alt }}" /></span>
{{ end }}
{{- .Content }}
{{ end }}