Skip to content

Commit

Permalink
Update feed.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Jun 29, 2024
1 parent 601e843 commit 06d99a7
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions codegen/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@ export function generateFeed() {
},
});
posts.forEach((post) => {
const authors = post.attrs.authors.map((author) => ({
name: author.name,
link: author.username
? `https://github.com/${author.username}`
: undefined,
}));
const date = new Date(post.attrs.date);
feed.addItem({
id: `${ORIGIN}/${post.id}`,
link: `${ORIGIN}/${post.id}`,
title: post.attrs.title,
description: post.attrs.description,
date: new Date(post.attrs.date),
published: new Date(post.attrs.date),
date,
published: date,
copyright: COPYRIGHT,
category: post.attrs.topics.map((topic) => ({
name: topic.toLowerCase(),
})),
author: post.attrs.authors.map((author) => ({
name: author.name,
link: author.username
? `https://github.com/${author.username}`
: undefined,
name: topic,
term: topic.toLowerCase(),
})),
author: authors,
contributor: authors,
});
});

Expand Down

0 comments on commit 06d99a7

Please sign in to comment.