{{ define "main" }}
{{ .Title }}
{{ with .Params.subtitle }}
{{ . }}
{{ end }}
{{ if in (slice "post" "talk") .Section }}
{{ partial "metadata.html" . }}
{{ end }}
{{ $image := "" }}
{{ if (.Resources.ByType "image").GetMatch "*featured*" }}
{{ $image = (.Resources.ByType "image").GetMatch "*featured*" }}
{{ else if resources.Get (index .Params.images 0) }}
{{ $image = resources.Get (index .Params.images 0) }}
{{ end }}
{{ with $image }}
{{ if ne $image.MediaType.SubType "svg" }}
{{ $image := .Fit (default "400x400" $.Params.image_size) }}
{{ end }}