{{ $rasters := slice "jpeg" "png" }} {{ $newres := "360x250 smart" }} {{/* immagine di default */}} {{- $featimg := (resources.Get "/images/placeholder_elenco.png").RelPermalink -}} {{- if .Params.image -}} {{/* se è stata definita un'immagine featured */}} {{- $img := .Page.Resources.GetMatch .Params.image -}} {{- if $img -}} {{- if in $rasters $img.MediaType.SubType -}} {{- $img = $img.Fill $newres -}} {{ end }} {{- $featimg = $img.RelPermalink -}} {{- end -}} {{- else if .Params.featured -}} {{/* se è stata definita un'immagine featured */}} {{- $img := .Page.Resources.GetMatch .Params.featured -}} {{- if $img -}} {{- if in $rasters $img.MediaType.SubType -}} {{- $img = $img.Fill $newres -}} {{ end }} {{- $featimg = $img.RelPermalink -}} {{- end -}} {{- else -}} {{/* altrimenti prendo la prima risorsa immagine disponibile */}} {{- $img := (.Page.Resources.ByType "image").GetMatch "**" -}} {{- if $img -}} {{- if in $rasters $img.MediaType.SubType -}} {{- $img = $img.Fill $newres -}} {{ end }} {{- $featimg = $img.RelPermalink -}} {{- end -}} {{- end -}} {{ .Params.image_alt }}

{{ .Title }}

{{- with .GetTerms "author" }} {{- range . -}} {{- end }} {{- end }} {{ if .Site.Params.show_post_dates | default true }} {{- with .Date }}{{ end }} {{ end }}

{{ with .Description }} {{- . | truncate 400 }} {{- else }} {{- .Summary | truncate 400 }} {{- end }}

{{ partial "tags.html" . }}