2024-07-13 18:12:16 +00:00
|
|
|
<section>
|
|
|
|
<div class="box post">
|
2024-11-12 13:08:17 +00:00
|
|
|
{{ $newres := "360x250 webp q50 smart" }}
|
2024-07-13 18:12:16 +00:00
|
|
|
|
2024-11-12 13:08:17 +00:00
|
|
|
{{- $image_src := "" }}
|
|
|
|
{{- $image_alt := "" }}
|
|
|
|
{{- $image_caption := "" }}
|
2024-09-18 13:25:24 +00:00
|
|
|
{{/* immagine di default */}}
|
2024-11-12 13:08:17 +00:00
|
|
|
{{- $image := (resources.Get "/images/placeholder_autore.png") -}}
|
|
|
|
|
|
|
|
{{/* priorità maggiore: image_list */}}
|
|
|
|
{{- if .Params.image_list }}
|
|
|
|
{{- $image_src = .Params.image_list.src }}
|
|
|
|
{{- with .Params.image_list.alt }}
|
|
|
|
{{- $image_alt = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Params.image_list.caption }}
|
|
|
|
{{- $image_caption = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* in alternativa: image_post */}}
|
|
|
|
{{- if and (not $image_src) .Params.image_post }}
|
|
|
|
{{- $image_src = .Params.image_post.src }}
|
|
|
|
{{- with .Params.image_post.alt }}
|
|
|
|
{{- $image_alt = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Params.image_post.caption }}
|
|
|
|
{{- $image_caption = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/* in alternativa uso il metodo vecchio */}}
|
|
|
|
{{- if and (not $image_src) .Params.image }}
|
|
|
|
{{- $image_src = .Params.image }}
|
|
|
|
{{- with .Params.image_alt }}
|
|
|
|
{{- $image_alt = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Params.image_caption }}
|
|
|
|
{{- $image_caption = . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if $image_src }}
|
|
|
|
{{- $image = .Page.Resources.GetMatch $image_src }}
|
|
|
|
{{- end}}
|
2024-07-13 18:12:16 +00:00
|
|
|
|
2024-11-12 13:08:17 +00:00
|
|
|
{{- $image = $image.Fill $newres -}}
|
2024-07-13 18:12:16 +00:00
|
|
|
|
2024-11-12 13:08:17 +00:00
|
|
|
<a href="{{ .RelPermalink }}" class="image left"><img src="{{ $image.RelPermalink }}" alt="{{ $image_alt }}" /></a>
|
2024-07-13 18:12:16 +00:00
|
|
|
<div class="inner">
|
|
|
|
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
2024-08-03 18:29:13 +00:00
|
|
|
{{ if .Site.Params.show_post_dates | default true }}
|
|
|
|
{{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }}
|
|
|
|
{{ end }}
|
2024-07-13 18:12:16 +00:00
|
|
|
<p>
|
|
|
|
{{ with .Description }}
|
2024-09-18 13:25:24 +00:00
|
|
|
{{- . | markdownify | truncate 400 }}
|
2024-07-13 18:12:16 +00:00
|
|
|
{{- else }}
|
2024-09-18 13:25:24 +00:00
|
|
|
{{- .Summary | markdownify | truncate 400 }}
|
2024-07-13 18:12:16 +00:00
|
|
|
{{- end }}
|
|
|
|
</p>
|
|
|
|
{{ partial "tags.html" . }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|