Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaud Lepretre <thibaud.lepretre@gmail.com>2021-08-27 19:21:28 +0300
committerThibaud Lepretre <thibaud.lepretre@gmail.com>2021-08-27 19:21:28 +0300
commit8aed37c3408e9147a591679959bdb38a97a5dff3 (patch)
treeac77206461275259b3673e9b7fd1333f67bad142 /layouts
parent8223447a05f53c1e7602e65957d5b4ab12567e76 (diff)
Apply clearReading to all mainSection pages
fixes #492
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/head.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 5396d8f..239fb2c 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,10 +1,10 @@
-{{- $.Scratch.Set "isPost" false -}}
+{{- $.Scratch.Set "isTypeInMainSections" false -}}
{{- if .IsPage -}}
- {{- if eq .Type "posts" -}}
- {{- $.Scratch.Set "isPost" true -}}
+ {{- if in site.Params.mainSections .Type -}}
+ {{- $.Scratch.Set "isTypeInMainSections" true -}}
{{- end -}}
{{- end -}}
-{{- if and (and ($.Scratch.Get "isPost") (lt .Site.Params.sidebarBehavior 3)) (or (and .Site.Params.clearReading (not .Params.clearReading)) .Params.clearReading) -}}
+{{- if and (and ($.Scratch.Get "isTypeInMainSections") (lt .Site.Params.sidebarBehavior 3)) (or (and .Site.Params.clearReading (not .Params.clearReading)) .Params.clearReading) -}}
{{- .Scratch.Set "sidebarBehavior" (add .Site.Params.sidebarBehavior 3) -}}
{{- else -}}
{{- .Scratch.Set "sidebarBehavior" .Site.Params.sidebarBehavior -}}