<div class="box post"> {{ $newres := "360x250 smart" }} {{- $image_src := "" }} {{- $image_alt := "" }} {{- $image_caption := "" }} {{/* immagine di default */}} {{- $image := (resources.Get "/images/placeholder_elenco.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}} {{- $image = $image.Fill $newres -}} <a href="{{ .RelPermalink }}" class="image left"><img src="{{ $image.RelPermalink }}" alt="{{ $image_alt }}" /></a> <div class="inner"> <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> {{- with .GetTerms "author" }} {{- range . -}} <div class="author"> di <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> </div> {{- end }} {{- end }} {{ if .Site.Params.show_post_dates | default true }} {{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }} {{ end }} <p> {{ with .Description }} {{- . | plainify | truncate 400 }} {{- else }} {{- .Summary | plainify | truncate 400 }} {{- end }} </p> {{ partial "tags.html" . }} </div> </div>