fix: add article content to description

This commit is contained in:
Oliver Davies 2022-10-13 00:15:24 +01:00
parent 5efaf23eca
commit 69112f3976

View file

@ -1,8 +1,20 @@
import rss from '@astrojs/rss';
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()
)
export const get = () => rss({
title: 'Daily list',
description: '',
site: 'https://www.oliverdavies.uk',
items: import.meta.glob('./daily-emails/**/*.{md,mdx}'),
})
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,
}))
});