Skip to content

Commit

Permalink
Prevent build of rss feeds and throw warning message if not production (
Browse files Browse the repository at this point in the history
  • Loading branch information
breezyfasano authored Sep 19, 2024
2 parents b6351b1 + f78eee3 commit 5721abb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion website/plugins/buildRSSFeeds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5721abb

Please sign in to comment.