2022-10-07 09:14:10 +01:00
|
|
|
import rss from '@astrojs/rss';
|
|
|
|
|
2022-10-13 00:15:24 +01:00
|
|
|
const emailImportResult = import.meta.glob('./daily-emails/**/*.md', { eager: true });
|
|
|
|
const emails = Object.values(emailImportResult)
|
|
|
|
.sort((a, b) =>
|
|
|
|
new Date(b.frontmatter.pubDate).valueOf() -
|
|
|
|
new Date(a.frontmatter.pubDate).valueOf()
|
|
|
|
)
|
|
|
|
|
2022-10-07 09:14:10 +01:00
|
|
|
export const get = () => rss({
|
2022-10-13 00:15:24 +01:00
|
|
|
title: 'Daily list',
|
|
|
|
description: 'A daily newsletter on software development, DevOps, community, and open-source.',
|
|
|
|
site: import.meta.env.SITE,
|
|
|
|
items: emails.map((email) => ({
|
|
|
|
description: email.compiledContent(),
|
|
|
|
link: email.url,
|
|
|
|
pubDate: email.frontmatter.pubDate,
|
|
|
|
title: email.frontmatter.title,
|
|
|
|
}))
|
|
|
|
});
|