hugo-theme-relearn/layouts/partials/archetype.html

15 lines
598 B
HTML
Raw Normal View History

{{- $hook := .hook }}
{{- $page := .page }}
{{- $parameter := .parameter }}
2022-07-05 22:15:33 +00:00
{{- $archetype := "default" }}
{{- if $page.Params.archetype }}
{{- $archetype = $page.Params.archetype }}
{{- else if $page.Params.chapter }}
2022-07-05 22:15:33 +00:00
{{- $archetype = "deprecated-chapter" }}
{{- else if $page.IsHome }}
2022-07-05 22:15:33 +00:00
{{- $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) }}