Improve formatting

This commit is contained in:
2023-04-11 16:02:54 +02:00
parent 268128c2f4
commit 6c9546b74a
22 changed files with 280 additions and 279 deletions

View File

@ -22,24 +22,26 @@ export function createFeed(posts: Post[]): Feed {
author: {
name: '@aymm',
link: 'https://metalhead.club/@aymm'
},
}
});
posts.forEach(p => {
posts.forEach((p) => {
feed.addItem({
title: p.content,
id: p.url,
link: p.url,
content: p.content,
author: [{
name: p.account.acct,
link: p.account.url
}],
author: [
{
name: p.account.acct,
link: p.account.url
}
],
date: new Date(p.created_at)
})
});
});
feed.addCategory('Music');
return feed;
}
export async function saveAtomFeed(feed: Feed) {
await fs.writeFile('feed.xml', feed.atom1(), { encoding: 'utf8' });
}
}