{{ $ := .root }} {{ $page := .page }} {{ $bg := $page.Params.design.background }} {{ if $page.Params.hero_media }}
{{ end }} {{ with $page.Title }}

{{ . | markdownify }}

{{ end }} {{ with $page.Content }}
{{ . }}
{{ end }} {{/* Call-to-action link */}} {{ if $page.Params.cta.url }} {{ $pack := or $page.Params.cta.icon_pack "fas" }} {{ $pack_prefix := $pack }} {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} {{ $link := $page.Params.cta.url }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} {{ $link = $link | relLangURL }} {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }}

{{ if $page.Params.cta.icon }}{{end}}{{ $page.Params.cta.label | markdownify | emojify | safeHTML }} {{/* Alternative Call-to-action link */}} {{ if $page.Params.cta_alt.url }} {{ $link := $page.Params.cta_alt.url }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} {{ $link = $link | relLangURL }} {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{ $page.Params.cta_alt.label | markdownify | emojify | safeHTML }} {{ end }}

{{ end }} {{/* Call-to-action note */}} {{ with $page.Params.cta_note }}

{{ .label | markdownify | emojify | safeHTML }}

{{ end }} {{/* Hero image */}} {{ if $page.Params.hero_media }}
{{- $image := ($page.Parent.Resources.ByType "image").GetMatch $page.Params.hero_media -}} {{- if not $image -}} {{- $image = resources.Get (path.Join "media" $page.Params.hero_media) -}} {{- end -}} {{ if $image }} {{ $isSVG := eq $image.MediaType.SubType "svg" }} {{ if $isSVG -}} {{ $page.Title }} {{- else }} {{ $legacy_img := $image.Resize "400x" }} {{ $img_src := "" }} {{ $img_src_set := slice }} {{ $widths := slice 1200 800 400 }} {{ range $widths }} {{ $src_link := ($image.Resize (printf "%dx" .)).RelPermalink }} {{ if eq $img_src "" }} {{ $img_src = $src_link }} {{ end }} {{ $img_src_set = $img_src_set | append (printf "%s %dw" $src_link .) }} {{ end }} {{ $img_src_set = delimit $img_src_set "," }} {{ $page.Title }} {{ end }} {{ end }}
{{ end }}