From 0987d6ccec727a69e4772dd68f7bff9b31ce6017 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 18 Oct 2021 15:21:46 +0100 Subject: [PATCH] Add magic string exclusion support --- src/index.11tydata.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.11tydata.js b/src/index.11tydata.js index 1ee62ab..35623ed 100644 --- a/src/index.11tydata.js +++ b/src/index.11tydata.js @@ -84,6 +84,11 @@ async function do_feeds() { global.feed_items.sort((a, b) => b.pubdate_obj - a.pubdate_obj); // console.log(feed_items.map(el => el.title)); + const magic_string = `__excludehullblogs__`; + global.feed_items = global.feed_items.filter((item) => item.title.indexOf(magic_string) === -1 + && item.description.indexOf(magic_string) === -1 + && item.content.indexOf(magic_string) === -1) + if(process.env.FILTER_FEED) { const feed_items_count = global.feed_items.length; global.feed_items = global.feed_items.filter((item) => !check_text(item.title)