Skip to content

Commit

Permalink
RSS feed update
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver committed May 7, 2024
1 parent 3357bc7 commit cf71777
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions website/plugins/buildRSSFeeds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ module.exports = function buildRSSFeedsPlugin() {
return {
name: 'docusaurus-build-rss-feeds-plugin',
async loadContent() {
// Release Notes directory
const releaseNotesDirectory = 'docs/docs/dbt-versions/release-notes'
// Get the release notes file
const releaseNotesFile = `docs/docs/dbt-versions/release-notes.md`

// Get all files and file data within all release notes directories
const releaseNotesFiles = getDirectoryFiles(releaseNotesDirectory, [], true)
// Get the contents of the release note file
const fileContent = fs.readFileSync(releaseNotesFile, 'utf-8');
const previousFileContent = fileContent;
const currentLines = fileContent.split('\n');
const previousLines = previousFileContent.split('\n');
const newLines = currentLines.filter(line => !previousLines.includes(line));

Check warning on line 19 in website/plugins/buildRSSFeeds/index.js

View workflow job for this annotation

GitHub Actions / eslint-check

'newLines' is assigned a value but never used

if(!releaseNotesFiles || !releaseNotesFiles.length)
if(!releaseNotesFile || !releaseNotesFile.length)
return null

// Generate RSS feeds
console.log('Generating RSS Feeds for dbt Cloud Release Notes')

// Prepare data and sort by update date
const releaseNotesData = releaseNotesFiles.map(note => {
const releaseNotesData = releaseNotesFile.map(note => {
const { data } = note

// Set properties for feed
Expand Down

0 comments on commit cf71777

Please sign in to comment.