mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 11:13:06 +00:00
14 lines
561 B
HTML
14 lines
561 B
HTML
|
{{- $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 }}
|