refactor: move website files to the root level
This commit is contained in:
parent
c2887ecbc5
commit
2cbbfd60ff
590 changed files with 0 additions and 4484 deletions
20
src/pages/archive.xml.js
Normal file
20
src/pages/archive.xml.js
Normal file
|
@ -0,0 +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 email list',
|
||||
description: 'A daily newsletter on software development, DevOps, community, and open-source.',
|
||||
site: import.meta.env.SITE,
|
||||
items: emails.slice(0, 1).map((email) => ({
|
||||
description: `<div style="max-width: 550px;">${email.compiledContent()}</div>`,
|
||||
link: `${import.meta.env.SITE}${email.frontmatter.permalink}`,
|
||||
title: email.frontmatter.title,
|
||||
pubDate: email.frontmatter.pubDate,
|
||||
}))
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue