{{- $hook := .hook }} {{- $page := .page }} {{- $parameter := .parameter }} {{- $archetype := "default" }} {{- if $page.Params.archetype }} {{- $archetype = $page.Params.archetype }} {{- else if $page.Params.chapter }} {{- $archetype = "deprecated-chapter" }} {{- else if $page.IsHome }} {{- $archetype = "deprecated-home" }} {{- end }} {{- if not (fileExists (printf "/layouts/partials/archetypes/%s" $archetype)) }} {{- $archetype = "default" }} {{- end }} {{- partial "output-partial.html" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter) }}