refactor: migrate page visibility control from Params.hidden to the new build.list parameter. (#1249)

* refactor: migrate page visibility control from `Params.hidden` to the new `build.list` parameter.

* Rename rss.xml to home.rss.xml
This commit is contained in:
Jimmy
2026-01-27 12:00:40 +01:00
committed by GitHub
parent dc0d105e7c
commit deceb17144
8 changed files with 7 additions and 14 deletions
+2 -1
View File
@@ -5,7 +5,8 @@ date: {{ .Date }}
image: image:
math: math:
license: license:
hidden: false
comments: true comments: true
draft: true draft: true
build:
list: always # Change to "never" to hide the page from the list
--- ---
@@ -1,4 +1,4 @@
{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }} {{ $related := (.Site.RegularPages.Related .) | first 5 }}
{{ with $related }} {{ with $related }}
<aside class="related-content--wrapper"> <aside class="related-content--wrapper">
<h2 class="section-title">{{ T "article.relatedContent" }}</h2> <h2 class="section-title">{{ T "article.relatedContent" }}</h2>
+1 -3
View File
@@ -3,15 +3,13 @@
{{- if .IsHome -}} {{- if .IsHome -}}
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }} {{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
{{ $pages = where $pages "Params.hidden" "!=" true }}
{{- $hasPages = true -}} {{- $hasPages = true -}}
{{- else if eq .Kind "term" -}} {{- else if eq .Kind "term" -}}
{{ $pages = where .Pages "Params.hidden" "!=" true }} {{ $pages = .Pages }}
{{- $hasPages = true -}} {{- $hasPages = true -}}
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}} {{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
{{ $subsections := .Sections }} {{ $subsections := .Sections }}
{{ $pages = .Pages | complement $subsections }} {{ $pages = .Pages | complement $subsections }}
{{ $pages = where $pages "Params.hidden" "!=" true }}
{{- if eq (len $pages) 0 -}} {{- if eq (len $pages) 0 -}}
{{/* See complete logic in list.html */}} {{/* See complete logic in list.html */}}
+1 -2
View File
@@ -10,8 +10,7 @@
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2> <h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }} {{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
{{ $filtered := where $pages "Params.hidden" "!=" true }} {{ $archives := $pages.GroupByDate "2006" }}
{{ $archives := $filtered.GroupByDate "2006" }}
<div class="widget-archive--list"> <div class="widget-archive--list">
{{ range $index, $item := first (add $limit 1) ($archives) }} {{ range $index, $item := first (add $limit 1) ($archives) }}
+1 -2
View File
@@ -16,9 +16,8 @@
</header> </header>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $filtered := where $pages "Params.hidden" "!=" true }}
{{ range $filtered.GroupByDate "2006" }} {{ range $pages.GroupByDate "2006" }}
{{ $id := lower (replace .Key " " "-") }} {{ $id := lower (replace .Key " " "-") }}
<div class="archives-group" id="{{ $id }}"> <div class="archives-group" id="{{ $id }}">
<h2 class="archives-date section-title"><a href="{{ $.RelPermalink }}#{{ $id }}">{{ .Key }}</a></h2> <h2 class="archives-date section-title"><a href="{{ $.RelPermalink }}#{{ $id }}">{{ .Key }}</a></h2>
-1
View File
@@ -6,7 +6,6 @@
{{- else -}} {{- else -}}
{{- $pages = $pctx.Pages -}} {{- $pages = $pctx.Pages -}}
{{- end -}} {{- end -}}
{{- $pages := where $pages "Params.hidden" "!=" true -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}} {{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}} {{- $pages = $pages | first $limit -}}
-1
View File
@@ -31,7 +31,6 @@
{{- $subsections := .Sections -}} {{- $subsections := .Sections -}}
{{- $pages := .Pages | complement $subsections -}} {{- $pages := .Pages | complement $subsections -}}
{{- $pages = where $pages "Params.hidden" "!=" true -}}
{{- if eq (len $pages) 0 -}} {{- if eq (len $pages) 0 -}}
{{/* If there are no normal pages, display subsections in list style, with pagination */}} {{/* If there are no normal pages, display subsections in list style, with pagination */}}
+1 -3
View File
@@ -1,9 +1,7 @@
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- $filtered := where $pages "Params.hidden" "!=" true -}}
{{- $result := slice -}} {{- $result := slice -}}
{{- range $filtered -}} {{- range $pages -}}
{{- $data := dict "title" .Title "date" .Date "permalink" .RelPermalink "content" (.Plain) -}} {{- $data := dict "title" .Title "date" .Date "permalink" .RelPermalink "content" (.Plain) -}}
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}} {{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}