fix: remove unwanted URLs for daily emails
This commit is contained in:
parent
69112f3976
commit
18a1dd0e03
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
layout: ../../layouts/PageLayout.astro
|
||||
title: First impressions of Astro
|
||||
pubDate: "2022-10-08"
|
||||
permalink: archive/2022/10/08/first-impressions-astro
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
layout: ../../layouts/DailyEmailLayout.astro
|
||||
title: Coding defensively, and Implicit vs explicit coding
|
||||
pubDate: "2022-10-09"
|
||||
permalink: archive/2022/10/09/coding-defensively-implicit-explicit
|
|
@ -1,6 +1,6 @@
|
|||
import rss from '@astrojs/rss';
|
||||
|
||||
const emailImportResult = import.meta.glob('./daily-emails/**/*.md', { eager: true });
|
||||
const emailImportResult = import.meta.glob('../daily-emails/*.md', { eager: true });
|
||||
const emails = Object.values(emailImportResult)
|
||||
.sort((a, b) =>
|
||||
new Date(b.frontmatter.pubDate).valueOf() -
|
||||
|
@ -8,13 +8,12 @@ const emails = Object.values(emailImportResult)
|
|||
)
|
||||
|
||||
export const get = () => rss({
|
||||
title: 'Daily list',
|
||||
title: 'Daily email 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,
|
||||
link: `${import.meta.env.SITE}${email.frontmatter.permalink}`,
|
||||
title: email.frontmatter.title,
|
||||
pubDate: email.frontmatter.pubDate,
|
||||
}))
|
||||
});
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import DailyEmailForm from '../../components/DailyEmailForm.astro'
|
||||
import PageLayout from '../../layouts/PageLayout.astro'
|
||||
import Layout from '../../layouts/DailyEmailLayout.astro'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const emails = await Astro.glob('../daily-emails/*.md')
|
||||
const emails = await Astro.glob('../../daily-emails/*.md')
|
||||
|
||||
return emails.map(email => ({
|
||||
params: {
|
||||
|
@ -16,6 +16,9 @@ export async function getStaticPaths() {
|
|||
}
|
||||
|
||||
const { Content } = Astro.props.email
|
||||
const { title } = Astro.props.email.frontmatter
|
||||
---
|
||||
|
||||
<Content />
|
||||
<Layout title={title}>
|
||||
<Content />
|
||||
</Layout>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import PageLayout from '../../layouts/PageLayout.astro'
|
||||
|
||||
const emails = await Astro.glob('../daily-emails/*.md');
|
||||
const emails = await Astro.glob('../../daily-emails/*.md');
|
||||
|
||||
const sortedEmails = emails
|
||||
.sort((a, b) =>
|
||||
|
|
Loading…
Reference in a new issue