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

12 lines
490 B
HTML
Raw Normal View History

2022-07-05 00:19:27 +02:00
{{- $archetype := "default" }}
{{- if .page.Params.archetype }}
{{- $archetype = .page.Params.archetype }}
{{- else if .page.Params.chapter }}
{{- $archetype = "chapter-deprecated" }}
{{- else if .page.IsHome }}
{{- $archetype = "home-deprecated" }}
{{- end }}
{{- if not (fileExists (printf "/layouts/partials/archetypes/%s.html" $archetype)) }}
{{- $archetype = "default" }}
{{- end }}
{{- partial (printf "archetypes/%s.html" $archetype) (dict "page" .page "content" .content) }}