Merge pull request #2853 from MaikelChan/header_space_list

🐛 Fixed `layoutBackgroundBlur` and `layoutBackgroundHeaderSpace` not affecting term and taxonomy pages
This commit is contained in:
Nuno C.
2026-04-13 22:39:41 +01:00
committed by GitHub
5 changed files with 27 additions and 13 deletions
+4
View File
@@ -121,6 +121,8 @@ forgejoDefaultServer = "https://v11.next.forgejo.org"
showTermCount = true showTermCount = true
showHero = false showHero = false
# heroStyle = "background" # valid options: basic, big, background, thumbAndBackground # heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
layoutBackgroundBlur = true # only used when heroStyle equals background or thumbAndBackground
layoutBackgroundHeaderSpace = true # only used when heroStyle equals background
showBreadcrumbs = false showBreadcrumbs = false
showViews = false showViews = false
showLikes = false showLikes = false
@@ -130,6 +132,8 @@ forgejoDefaultServer = "https://v11.next.forgejo.org"
[term] [term]
showHero = false showHero = false
# heroStyle = "background" # valid options: basic, big, background, thumbAndBackground # heroStyle = "background" # valid options: basic, big, background, thumbAndBackground
layoutBackgroundBlur = true # only used when heroStyle equals background or thumbAndBackground
layoutBackgroundHeaderSpace = true # only used when heroStyle equals background
showBreadcrumbs = false showBreadcrumbs = false
showViews = false showViews = false
showLikes = false showLikes = false
@@ -245,8 +245,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `article.showAuthorBottom` | `false` | Author boxes are displayed at the bottom of each page instead of the top. | | `article.showAuthorBottom` | `false` | Author boxes are displayed at the bottom of each page instead of the top. |
| `article.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each article page. | | `article.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each article page. |
| `article.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `article.showHero = true`. | | `article.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `article.showHero = true`. |
| `article.layoutBackgroundBlur` | `true` | Makes the background image in the background article heroStyle blur with the scroll | | `article.layoutBackgroundBlur` | `true` | Makes the background image in the background article heroStyle blur with the scroll. Only used when `heroStyle` equals `background` or `thumbAndBackground`. |
| `article.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. | | `article.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. Only used when `heroStyle` equals `background`. |
| `article.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the article header. | | `article.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the article header. |
| `article.showDraftLabel` | `true` | Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`. | | `article.showDraftLabel` | `true` | Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`. |
| `article.showEdit` | `false` | Whether or not the link to edit the article content should be displayed. | | `article.showEdit` | `false` | Whether or not the link to edit the article content should be displayed. |
@@ -277,9 +277,9 @@ Many of the article defaults here can be overridden on a per article basis by sp
| --- | --- | --- | | --- | --- | --- |
| `list.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each list page. | | `list.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each list page. |
| `list.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `list.showHero = true`. | | `list.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `list.showHero = true`. |
| `list.layoutBackgroundBlur` | `true` | Makes the background image in the background list heroStyle blur with the scroll. Only used when `heroStyle` equals `background` or `thumbAndBackground`. |
| `list.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. Only used when `heroStyle` equals `background`. |
| `list.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the header on list pages. | | `list.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the header on list pages. |
| `list.layoutBackgroundBlur` | `true` | Makes the background image in the background list heroStyle blur with the scroll |
| `list.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. |
| `list.showTableOfContents` | `false` | Whether or not the table of contents is displayed on list pages. | | `list.showTableOfContents` | `false` | Whether or not the table of contents is displayed on list pages. |
| `list.showSummary` | `false` | Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration). | | `list.showSummary` | `false` | Whether or not article summaries are displayed on list pages. If a summary is not provided in the [front matter]({{< ref "front-matter" >}}), one will be auto generated using the `summaryLength` parameter in the [site configuration](#site-configuration). |
| `list.showViews` | `false` | Whether or not list views are displayed. This requires firebase integrations to be enabled, look below. | | `list.showViews` | `false` | Whether or not list views are displayed. This requires firebase integrations to be enabled, look below. |
@@ -305,6 +305,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
| `taxonomy.showTermCount` | `true` | Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing. | | `taxonomy.showTermCount` | `true` | Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing. |
| `taxonomy.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each taxonomy page. | | `taxonomy.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each taxonomy page. |
| `taxonomy.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `taxonomy.showHero = true`. | | `taxonomy.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `taxonomy.showHero = true`. |
| `taxonomy.layoutBackgroundBlur` | `true` | Makes the background image in the background taxonomy heroStyle blur with the scroll. Only used when `heroStyle` equals `background` or `thumbAndBackground`. |
| `taxonomy.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. Only used when `heroStyle` equals `background`. |
| `taxonomy.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the taxonomy header. | | `taxonomy.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the taxonomy header. |
| `taxonomy.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. | | `taxonomy.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. |
| `taxonomy.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. | | `taxonomy.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. |
@@ -317,6 +319,8 @@ Many of the article defaults here can be overridden on a per article basis by sp
| --- | --- | --- | | --- | --- | --- |
| `term.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each term page. | | `term.showHero` | `false` | Whether the thumbnail image will be shown as a hero image within each term page. |
| `term.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `term.showHero = true`. | | `term.heroStyle` | _Not set_ | Style to display the hero image, valid options are: `basic`, `big`, `background`, `thumbAndBackground`. Effective only if `term.showHero = true`. |
| `term.layoutBackgroundBlur` | `true` | Makes the background image in the background term heroStyle blur with the scroll. Only used when `heroStyle` equals `background` or `thumbAndBackground`. |
| `term.layoutBackgroundHeaderSpace` | `true` | Add space between the header and the body. Only used when `heroStyle` equals `background`. |
| `term.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the term header. | | `term.showBreadcrumbs` | `false` | Whether or not breadcrumbs are displayed in the term header. |
| `term.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. | | `term.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. |
| `term.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. | | `term.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. |
+1 -1
View File
@@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
{{ .Scratch.Set "scope" "list" }} {{ .Scratch.Set "scope" "terms" }}
{{ $showHero := .Params.showHero | default site.Params.taxonomy.showHero | default false }} {{ $showHero := .Params.showHero | default site.Params.taxonomy.showHero | default false }}
{{ if $showHero }} {{ if $showHero }}
{{ $heroStyle := print "hero/" site.Params.taxonomy.heroStyle ".html" }} {{ $heroStyle := print "hero/" site.Params.taxonomy.heroStyle ".html" }}
+9 -5
View File
@@ -44,15 +44,19 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }} {{ $scope := .Scratch.Get "scope" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or {{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList)) (and ($.Site.Params.article.layoutBackgroundBlur | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList)) (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 {{ $shouldAddHeaderSpace := $.Params.layoutBackgroundHeaderSpace | default (or
(and ($.Site.Params.article.layoutBackgroundHeaderSpace | default true) (not $isParentList)) (and ($.Site.Params.article.layoutBackgroundHeaderSpace | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundHeaderSpace | default true) ($isParentList)) (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 }}
{{ end }} {{ end }}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }} {{ $scope := .Scratch.Get "scope" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or {{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList)) (and ($.Site.Params.article.layoutBackgroundBlur | default true) (eq $scope "single"))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList)) (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"))
) )
}} }}