From b5ec2a9ccfb2c1c53972c2044a89ae9256f6af1c Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Wed, 25 Dec 2019 14:48:31 +0100 Subject: [PATCH] Reverse "postSections" to "ignoredSections" --- layouts/_default/list.jsonfeed.json | 3 ++- layouts/_default/rss.xml | 3 ++- layouts/index.html | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/layouts/_default/list.jsonfeed.json b/layouts/_default/list.jsonfeed.json index 3701b00..2f2765b 100644 --- a/layouts/_default/list.jsonfeed.json +++ b/layouts/_default/list.jsonfeed.json @@ -1,6 +1,7 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $ignoredSections := ($.Param "ignoredSections" | default (slice "ignored")) -}} +{{- $pages := ( where $pctx.RegularPages "Type" "not in" $ignoredSections ) -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 5f064d3..8085140 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,6 +1,7 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $ignoredSections := ($.Param "ignoredSections" | default (slice "ignored")) -}} +{{- $pages := ( where $pctx.RegularPages "Type" "not in" $ignoredSections ) -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/index.html b/layouts/index.html index ba31917..b9392c1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,8 +5,8 @@ {{ . }} {{- end }} - {{- $postSections := ($.Param "postSections" | default (slice "posts")) }} - {{- $paginator := .Paginate ( where .Site.RegularPages "Type" "in" $postSections ) }} + {{- $ignoredSections := ($.Param "ignoredSections" | default (slice "ignored")) }} + {{- $paginator := .Paginate ( where .Site.RegularPages "Type" "not in" $ignoredSections ) }} {{- range $paginator.Pages }} {{- .Render "summary" }} {{- end }}