{{ $page := . }} {{ $featured := (.Resources.ByType "image").GetMatch "*featured*" }} {{ $anchor := $page.Params.image.focal_point | default "Smart" }} {{/* Set default titles for node pages */}} {{ $title := .Title }} {{ if and (not $title) .IsNode }} {{ if eq .Type "post" }} {{ $title = i18n "posts" }} {{ else if eq .Type "talk" }} {{ $title = i18n "talks" }} {{ else if eq .Type "publication" }} {{ $title = i18n "publications" }} {{end}} {{end}} {{/* Header image */}} {{ if and .Params.header.image (not $featured) }}
{{ $img_src := urls.Parse .Params.header.image }} {{ if $img_src.Scheme }} {{ else }} {{ end }} {{ with .Params.header.caption }}{{ . | markdownify | emojify }}{{ end }}
{{end}} {{/* Featured image */}} {{ with $featured }} {{ $image := .Fill (printf "1600x400 q90 %s" $anchor) }}
{{ with $.Params.image.caption }}{{ . | markdownify | emojify }}{{ end }}
{{ $image := .Fill (printf "680x500 q90 %s" $anchor) }}

{{ $title }}

{{ with $page.Params.subtitle }}

{{ . | markdownify | emojify }}

{{end}} {{ partial "page_metadata" (dict "content" $page "is_list" 1) }} {{ partial "share.html" $page }}
{{ with $.Params.image.caption }}{{ . | markdownify | emojify }}{{ end }}

{{ $title }}

{{ with $page.Params.subtitle }}

{{ . | markdownify | emojify }}

{{end}} {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
{{else}} {{/* Case when page has no image */}} {{/* Wider container for nodes */}} {{ $ctnr := "article-container" }} {{ if $page.IsNode }} {{ $ctnr = "universal-wrapper" }} {{end}}

{{ $title }}

{{ with $page.Params.subtitle }}

{{ . | markdownify | emojify }}

{{end}} {{ if not .IsNode }} {{ partial "page_metadata" (dict "content" $page "is_list" 0) }} {{end}}
{{end}}