Properly implement layoutBackgroundBlur and layoutBackgroundHeaderSpace in term and taxonomy

This commit is contained in:
MaikelChan
2026-03-23 08:00:37 +01:00
parent ef712c33f9
commit a0fc381ba9
6 changed files with 24 additions and 10 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ .Scratch.Set "scope" "term" }}
{{ $showHero := .Params.showHero | default site.Params.term.showHero | default false }}
{{ if $showHero }}
{{ $heroStyle := print "hero/" site.Params.term.heroStyle ".html" }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ .Scratch.Set "scope" "terms" }}
{{ $showHero := .Params.showHero | default site.Params.taxonomy.showHero | default false }}
{{ if $showHero }}
{{ $heroStyle := print "hero/" site.Params.taxonomy.heroStyle ".html" }}
+9 -5
View File
@@ -44,15 +44,19 @@
{{ end }}
{{ end }}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $scope := .Scratch.Get "scope" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList))
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) (eq $scope "list"))
(and ($.Site.Params.taxonomy.layoutBackgroundBlur | default true) (eq $scope "terms"))
(and ($.Site.Params.term.layoutBackgroundBlur | default true) (eq $scope "term"))
)
}}
{{ $shouldAddHeaderSpace := $.Params.layoutBackgroundHeaderSpace | default (or
(and ($.Site.Params.article.layoutBackgroundHeaderSpace | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundHeaderSpace | default true) ($isParentList))
(and ($.Site.Params.article.layoutBackgroundHeaderSpace | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundHeaderSpace | default true) (eq $scope "list"))
(and ($.Site.Params.taxonomy.layoutBackgroundHeaderSpace | default true) (eq $scope "terms"))
(and ($.Site.Params.term.layoutBackgroundHeaderSpace | default true) (eq $scope "term"))
)
}}
@@ -76,10 +76,12 @@
{{ end }}
{{ end }}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $scope := .Scratch.Get "scope" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList))
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) (eq $scope "list"))
(and ($.Site.Params.taxonomy.layoutBackgroundBlur | default true) (eq $scope "terms"))
(and ($.Site.Params.term.layoutBackgroundBlur | default true) (eq $scope "term"))
)
}}