theme: run hugo demo site without warning #736

This commit is contained in:
Sören Weber 2023-11-28 22:00:44 +01:00
parent 9227dfd41f
commit dfba891622
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -10,10 +10,16 @@
{{- else if $page.Params.archetype }}
{{- $archetype = $page.Params.archetype }}
{{- else if $page.Params.chapter }}
{{- $archetype = "chapter" }}
{{- if findRE `(?s)<h1.*?>.*?</h1>` .Content }}
{{- $archetype = "deprecated-chapter" }}
{{- end }}
{{- else if $page.IsHome }}
{{- $archetype = "home" }}
{{- if findRE `(?s)<h1.*?>.*?</h1>` .Content }}
{{- $archetype = "deprecated-home" }}
{{- end }}
{{- end }}
{{- $f := printf "/layouts/partials/archetypes/%s" $archetype }}
{{- if not (partialCached "fileExists.hugo" $f $f) }}
{{- $archetype = "default" }}