Remove draft posts from RSS and Atom feeds

This commit is contained in:
Eryn Wells 2024-11-04 08:45:02 -08:00
parent 256eae44e9
commit 4689129355
2 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
{{- $pages := .Site.RegularPages -}} {{- $pages := where .Site.RegularPages "Draft" "eq" false -}}
{{- $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 -}}

View file

@ -5,9 +5,9 @@
{{- $pages := slice -}} {{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}} {{- if or $.IsHome $.IsSection -}}
{{- $pages = $pageContext.RegularPages -}} {{- $pages = where $pageContext.RegularPages "Draft" "eq" false -}}
{{- else -}} {{- else -}}
{{- $pages = $pageContext.Pages -}} {{- $pages = where $pageContext.Pages "Draft" "eq" false -}}
{{- end -}} {{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}