From dfb6584370828c0e077b25ff45c31bbf7e36ab02 Mon Sep 17 00:00:00 2001 From: Breezy Fasano Date: Wed, 18 Sep 2024 11:43:48 -0500 Subject: [PATCH] Prevent build of rss feeds and throw warning message if not production --- website/plugins/buildRSSFeeds/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/website/plugins/buildRSSFeeds/index.js b/website/plugins/buildRSSFeeds/index.js index 5b8d3071708..9911313b217 100644 --- a/website/plugins/buildRSSFeeds/index.js +++ b/website/plugins/buildRSSFeeds/index.js @@ -8,13 +8,20 @@ module.exports = function buildRSSFeedsPlugin() { return { name: 'docusaurus-build-rss-feeds-plugin', async loadContent() { + + // Skip generating RSS feeds in non-production environments + if (process.env.VERCEL_ENV !== "production") { + console.log('RSS Feeds are only generated in production. Skipping creation of RSS Feed.') + return null + } + // Release Notes directory const releaseNotesDirectory = 'docs/docs/dbt-versions/release-notes' // Get all files and file data within all release notes directories const releaseNotesFiles = getDirectoryFiles(releaseNotesDirectory, [], true) - if(!releaseNotesFiles || !releaseNotesFiles.length) + if (!releaseNotesFiles || !releaseNotesFiles.length) return null // Generate RSS feeds