{{ $page := .Page }} {{ $item := .Get "page" }} {{/* Default compact view. */}} {{ $view := (.Get "view") | default "compact" }} {{/* Hugo stores all shortcode args as strings, however `render_view` expects legacy numeric views 1-4 to be int */}} {{ $view = cond (in (slice "1" "2" "3" "4") $view) (int $view) $view }} {{ with site.GetPage $item }} {{ partial "functions/render_view" (dict "page" $page "item" . "view" $view "index" 0) }} {{ end }}