From 468912935563a04a17cc03ff66096849a41a0ea8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 4 Nov 2024 08:45:02 -0800 Subject: [PATCH] Remove draft posts from RSS and Atom feeds --- layouts/index.atom | 2 +- layouts/index.rss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/index.atom b/layouts/index.atom index 2e564a3..c231f3e 100644 --- a/layouts/index.atom +++ b/layouts/index.atom @@ -1,4 +1,4 @@ -{{- $pages := .Site.RegularPages -}} +{{- $pages := where .Site.RegularPages "Draft" "eq" false -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/layouts/index.rss b/layouts/index.rss index e46c88d..1ce8225 100644 --- a/layouts/index.rss +++ b/layouts/index.rss @@ -5,9 +5,9 @@ {{- $pages := slice -}} {{- if or $.IsHome $.IsSection -}} - {{- $pages = $pageContext.RegularPages -}} + {{- $pages = where $pageContext.RegularPages "Draft" "eq" false -}} {{- else -}} - {{- $pages = $pageContext.Pages -}} + {{- $pages = where $pageContext.Pages "Draft" "eq" false -}} {{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}