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

14 lines
561 B
HTML
Raw Normal View History

2022-07-05 22:15:33 +00:00
{{- $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 }}
{{- if (fileExists (printf "/layouts/partials/archetypes/%s/%s.html" $archetype .hook)) }}
{{- partial (printf "archetypes/%s/%s.html" $archetype .hook) . }}
{{- end }}