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
parent8223447a05f53c1e7602e65957d5b4ab12567e76 (diff)
Apply clearReading to all mainSection pages
fixes #492
-rw-r--r--docs/user.md2
-rw-r--r--layouts/partials/head.html8
2 files changed, 5 insertions, 5 deletions
diff --git a/docs/user.md b/docs/user.md
index 9e860cf..c00270b 100644
--- a/docs/user.md
+++ b/docs/user.md
@@ -354,7 +354,7 @@ E.g to display a shortcut to open algolia search window :
| Variable | Description |
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| sidebarBehavior | Define the behavior of the header and sidebar :<ul><li>1: Display extra large sidebar on extra large screen, large sidebar on large screen, medium sidebar on medium screen and header bar on small screen and extra large sidebar is swiped on extra large screen and large sidebar on all lower screens when open button is clicked (default)</li><li>2: Display large sidebar on extra large & large screen, medium sidebar on medium screen and header bar on small screen and large sidebar is swiped when open button is clicked</li><li>3: Display medium sidebar on large and medium screen and header bar on small screen and medium sidebar is swiped when open button is clicked</li><li>4: Display header bar on all screens, extra large sidebar is swiped on extra large screen and large sidebar is swiped on all lower screens</li><li>5: Display header bar on all screens and large sidebar is swiped on large screen</li><li>6: Display header bar on all screens and medium sidebar is swiped</li></ul> |
-| clearReading | Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `sidebarBehavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `params.clearReading` value in theme configuration file. |
+| clearReading | Hide sidebar on all page (that is part of [mainSections](https://gohugo.io/functions/where/#mainsections)) to let page take full width to improve reading, and enjoy wide images and cover images. Useless if `sidebarBehavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `params.clearReading` value in theme configuration file. |
| thumbnailImage | Display thumbnail image of each post on index pages |
| thumbnailImagePosition | Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). Set this value to `right` if you have old posts to keep the old style on them and define `thumbnailImagePosition` on a post to overwrite this setting. (Default: `right`) |
| autoThumbnailImage | Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. Set this value to `true` if you have old posts that use the cover image or the first photo as the thumbnail image and set `autoThumbnailImage` to `false` on a post to overwrite this setting. (Default : `true`) |
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 -}}