{{- $img := .Params.img -}} {{- $refImg := "" -}} {{- if .Params.imgref -}} {{- range where .Site.RegularPages "Params.pageid" "eq" .Params.imgref -}} {{- $refImg = .Params.img -}} {{- end -}} {{- end -}} {{- if not $img -}} {{- $img = $refImg -}} {{- end -}} {{ if $img -}} {{- $image := resources.Get (printf "img/%s" $img) -}} {{- if eq $image nil -}} {{- warnf "not found: %v" $img -}} {{- else -}} {{- $image = $image.Resize "400x" -}} {{ .Title }} {{- end -}} {{- else if .Params.teaser -}}

{{ .Params.teaser }}

{{- else if .Site.Params.defaultImage -}} {{ .Site.Title }} {{- end }}
{{ .Title | truncate 30 }} {{- if and (not .Params.nodate) .Date -}} {{- end }}

{{ .Summary | truncate 130 }}