2024-07-09 21:10:03 +00:00
|
|
|
{{ 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>
|
|
|
|
|
2024-07-13 18:19:41 +00:00
|
|
|
{{- if or .Params.image .Params.featured }}
|
2024-07-09 21:10:03 +00:00
|
|
|
|
2024-07-13 18:19:41 +00:00
|
|
|
{{- $maxHeight := 600 -}}
|
2024-07-14 09:16:04 +00:00
|
|
|
{{ $rasters := slice "jpeg" "png" }}
|
2024-07-13 18:19:41 +00:00
|
|
|
{{- $img := "#" -}}
|
2024-07-09 21:10:03 +00:00
|
|
|
|
|
|
|
{{- if .Params.image -}}
|
|
|
|
{{/* se è stata definita un'immagine featured */}}
|
2024-07-13 18:19:41 +00:00
|
|
|
{{- $img = .Page.Resources.GetMatch .Params.image -}}
|
2024-07-09 21:10:03 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- if .Params.featured -}}
|
|
|
|
{{/* se è stata definita un'immagine featured */}}
|
2024-07-13 18:19:41 +00:00
|
|
|
{{- $img = .Page.Resources.GetMatch .Params.featured -}}
|
2024-07-09 21:10:03 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
2024-07-13 18:19:41 +00:00
|
|
|
<span class="image featured">
|
2024-07-14 09:16:04 +00:00
|
|
|
{{- if in $rasters $img.MediaType.SubType -}}
|
|
|
|
{{- $img = $img.Resize (printf "x%d" $maxHeight) -}}
|
2024-07-16 07:53:53 +00:00
|
|
|
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
|
2024-07-14 09:16:04 +00:00
|
|
|
{{ else }}
|
|
|
|
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
|
|
|
|
{{ end }}
|
2024-07-13 18:19:41 +00:00
|
|
|
</span>
|
2024-07-09 21:10:03 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{- .Content }}
|
|
|
|
{{ end }}
|