{{- $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)).Resize "400x" -}} {{ .Title }} {{ else if .Params.teaser }}

{{ .Params.teaser }}

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

{{ .Summary | truncate 100 }}