Skip to content

Commit

Permalink
chore: update issue template scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 17, 2024
1 parent a474d0d commit 9ae29f3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/scripts/create-rss.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,18 @@ const rssFilePath = `./feeds/rss/${year}-${week}.json`;
const oldRss = await fs.readJSON('./feeds/old.json');
// oldRss.items 和 rss.items 合并
// 新的 newItems 根据时间排序,通过id 去重
let rssItems = oldRss.concat(rss)
let rssItems = oldRss.concat(rss).map((item, index, self) => {
if (item.id === rssItem.id) {
item.url = rssItem.url;
item.title = rssItem.title;
item.content_html = rssItem.content_html;
item.summary = rssItem.summary;
item.banner_image = rssItem.banner_image;
item.date_published = rssItem.date_published;
item.author = rssItem.author;
}
return item;
})
rssItems.sort((a, b) => new Date(b.date_published) - new Date(a.date_published))

// 通过 rssItems 中的 id 去重复
Expand Down

0 comments on commit 9ae29f3

Please sign in to comment.