{{ define "main" }}
{{ .Title }}
{{ with .Params.subtitle }}
{{ . }}
{{ end }}
{{ $image := "" }}
{{ if resources.Get (index .Params.images 0) }}
{{ $image = resources.Get (index .Params.images 0) }}
{{ else if (.Resources.ByType "image").GetMatch "*featured*" }}
{{ $image = (.Resources.ByType "image").GetMatch "*featured*" }}
{{ end }}
{{ with $image }}
{{ $image := .Fit (default "400x400" $.Params.image_size) }}