{{ $type := index .Params "type" }}
{{ if eq $type "youtube" }} {{/* copy pasted from hugo source code */}}
{{ else }} {{ $src := .Get "src" }} {{ $split_src := split $src "." }} {{ $extension := index $split_src (sub (len $split_src) 1) }} {{- if eq $extension "png" -}} {{ $originals := (.Page.Resources.ByType "image") }} {{ $original := $originals.GetMatch (printf "*%s" (path.Base $src)) }} {{ $resized_width := math.Min $original.Width 1024 }} {{ $resized := $original.Resize (print $resized_width "x q90 jpg" ) }} {{- else -}} {{- end -}} {{ end }} {{ with .Get "title" }}

{{ . | markdownify }}

{{ end }}