From f6487b7a9c19cd35df55bd03b4d007f6478cdcba Mon Sep 17 00:00:00 2001 From: Carlana Johnson Date: Mon, 15 Jul 2024 12:35:51 -0400 Subject: [PATCH] Feeds: Check feed-exclude parameter --- layouts/feeds/full.json | 5 +++-- layouts/feeds/rss.xml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/feeds/full.json b/layouts/feeds/full.json index de8ae2c867..cd119c3c4a 100644 --- a/layouts/feeds/full.json +++ b/layouts/feeds/full.json @@ -3,6 +3,7 @@ {{- $sc := site.GetPage "/statecollege/_index.md" -}} {{- $stories := union $news.RegularPages $sc.RegularPages -}} {{- $stories = sort $stories ".PublishDate" "desc" -}} +{{- $stories = where $stories `Params.feed-exclude` "ne" true -}} {{- range first 15 $stories -}} {{- $date := .Date.Format "2006-01-02T15:04:05Z07:00" -}} {{- $item := dict @@ -22,8 +23,8 @@ "absURL" true -}} {{- $url := partial "helper/imgproxy" $imgOpt -}} - {{ $description := .Param "image-description" }} - {{ $credit := .Param "image-credit" }} + {{- $description := .Param "image-description" -}} + {{- $credit := .Param "image-credit" -}} {{- $item = $item | merge (dict "image" $url "image_description" $description diff --git a/layouts/feeds/rss.xml b/layouts/feeds/rss.xml index 056c8762a5..e789a6fe52 100644 --- a/layouts/feeds/rss.xml +++ b/layouts/feeds/rss.xml @@ -3,7 +3,8 @@ {{- $sc := site.GetPage "/statecollege/_index.md" -}} {{- $stories := union $news.RegularPages $sc.RegularPages -}} {{- $stories = sort $stories ".PublishDate" "desc" -}} -{{ $description := (site.GetPage "/_index.md").Description }} +{{- $stories = where $stories `Params.feed-exclude` "ne" true -}} +{{- $description := (site.GetPage "/_index.md").Description -}}