From fffeb50ceeba6eb784a7c4b1d19fc147c52ec6d8 Mon Sep 17 00:00:00 2001 From: HEIGE-PCloud Date: Thu, 5 Oct 2023 13:12:06 +0100 Subject: [PATCH] feat: customisable main section Close #1070 --- layouts/index.html | 2 +- layouts/index.rss.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 8150e328f..d603a9825 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -21,7 +21,7 @@ {{- /* Posts */ -}} {{- if ne $posts.enable false | and .Site.RegularPages -}} {{- /* Paginate */ -}} - {{- $pages := where .Site.RegularPages "Type" "posts" -}} + {{- $pages := where .Site.RegularPages "Type" "in" site.Params.mainSections -}} {{- if .Site.Params.page.hiddenFromHomePage -}} {{- $pages = where $pages "Params.hiddenfromhomepage" false -}} {{- else -}} diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml index 355c26a5b..4bc04b165 100644 --- a/layouts/index.rss.xml +++ b/layouts/index.rss.xml @@ -36,7 +36,7 @@ {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} - {{- range where .Site.RegularPages "Type" "posts" | first (.Site.Params.home.rss | default 10) -}} + {{- range where .Site.RegularPages "Type" "in" site.Params.mainSections | first (.Site.Params.home.rss | default 10) -}} {{- dict "Page" . "Site" .Site | partial "rss/item.html" -}} {{- end -}}