Skip to content

Commit

Permalink
fewgge
Browse files Browse the repository at this point in the history
  • Loading branch information
vishvamsinh28 committed Nov 1, 2024
1 parent 2312a57 commit d77cf7a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/build-rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ module.exports = async function rssFeed(type, title, desc, outputPath) {
rss.channel.generator = 'next.js'
rss.channel.item = []

const invalidPosts = posts.filter(post =>
!post.title || !post.slug || !post.excerpt || !post.date
);

if (invalidPosts.length > 0) {
throw new Error('Missing required fields in post data');
}

for (let post of posts) {
const invalidPosts = posts.filter(post =>
!post.title || !post.slug || !post.excerpt || !post.date
);
if (invalidPosts.length > 0) {
throw new Error('Missing required fields in post data');
}
const link = `${base}${post.slug}${tracking}`;
const { title, excerpt, date } = post;
const pubDate = new Date(date).toUTCString();
Expand Down

0 comments on commit d77cf7a

Please sign in to comment.