2022-07-09 08:37:39 +00:00
|
|
|
{{- $hook := .hook }}
|
|
|
|
{{- $page := .page }}
|
|
|
|
{{- $parameter := .parameter }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- $outputFormat := .outputFormat }}
|
|
|
|
{{- if not $outputFormat }}
|
|
|
|
{{- $outputFormat = partial "output-format.hugo" $page }}
|
|
|
|
{{- end }}
|
2022-07-05 22:15:33 +00:00
|
|
|
{{- $archetype := "default" }}
|
2023-06-28 18:34:32 +00:00
|
|
|
{{- if not $page.File }}
|
|
|
|
{{- else if $page.Params.archetype }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- $archetype = $page.Params.archetype }}
|
|
|
|
{{- else if $page.Params.chapter }}
|
2022-07-05 22:15:33 +00:00
|
|
|
{{- $archetype = "deprecated-chapter" }}
|
2022-07-09 08:37:39 +00:00
|
|
|
{{- else if $page.IsHome }}
|
2022-07-05 22:15:33 +00:00
|
|
|
{{- $archetype = "deprecated-home" }}
|
|
|
|
{{- end }}
|
2022-11-12 14:16:53 +00:00
|
|
|
{{- $f := printf "/layouts/partials/archetypes/%s" $archetype }}
|
|
|
|
{{- if not (partialCached "fileExists.hugo" $f $f) }}
|
2022-07-05 22:15:33 +00:00
|
|
|
{{- $archetype = "default" }}
|
|
|
|
{{- end }}
|
2022-11-13 09:55:17 +00:00
|
|
|
{{- partial "output-partial.hugo" (dict "base" (printf "archetypes/%s/%s" $archetype $hook) "page" $page "parameter" $parameter "outputFormat" $outputFormat) }}
|