fix: remove unwanted URLs for daily emails

This commit is contained in:
Oliver Davies 2022-10-13 08:40:06 +01:00
parent 69112f3976
commit 18a1dd0e03
53 changed files with 11 additions and 11 deletions

View file

@ -1,5 +1,4 @@
--- ---
layout: ../../layouts/PageLayout.astro
title: First impressions of Astro title: First impressions of Astro
pubDate: "2022-10-08" pubDate: "2022-10-08"
permalink: archive/2022/10/08/first-impressions-astro permalink: archive/2022/10/08/first-impressions-astro

View file

@ -1,5 +1,4 @@
--- ---
layout: ../../layouts/DailyEmailLayout.astro
title: Coding defensively, and Implicit vs explicit coding title: Coding defensively, and Implicit vs explicit coding
pubDate: "2022-10-09" pubDate: "2022-10-09"
permalink: archive/2022/10/09/coding-defensively-implicit-explicit permalink: archive/2022/10/09/coding-defensively-implicit-explicit

View file

@ -1,6 +1,6 @@
import rss from '@astrojs/rss'; 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) const emails = Object.values(emailImportResult)
.sort((a, b) => .sort((a, b) =>
new Date(b.frontmatter.pubDate).valueOf() - new Date(b.frontmatter.pubDate).valueOf() -
@ -8,13 +8,12 @@ const emails = Object.values(emailImportResult)
) )
export const get = () => rss({ export const get = () => rss({
title: 'Daily list', title: 'Daily email list',
description: 'A daily newsletter on software development, DevOps, community, and open-source.', description: 'A daily newsletter on software development, DevOps, community, and open-source.',
site: import.meta.env.SITE, site: import.meta.env.SITE,
items: emails.map((email) => ({ items: emails.map((email) => ({
description: email.compiledContent(), link: `${import.meta.env.SITE}${email.frontmatter.permalink}`,
link: email.url,
pubDate: email.frontmatter.pubDate,
title: email.frontmatter.title, title: email.frontmatter.title,
pubDate: email.frontmatter.pubDate,
})) }))
}); });

View file

@ -1,9 +1,9 @@
--- ---
import DailyEmailForm from '../../components/DailyEmailForm.astro' import DailyEmailForm from '../../components/DailyEmailForm.astro'
import PageLayout from '../../layouts/PageLayout.astro' import Layout from '../../layouts/DailyEmailLayout.astro'
export async function getStaticPaths() { export async function getStaticPaths() {
const emails = await Astro.glob('../daily-emails/*.md') const emails = await Astro.glob('../../daily-emails/*.md')
return emails.map(email => ({ return emails.map(email => ({
params: { params: {
@ -16,6 +16,9 @@ export async function getStaticPaths() {
} }
const { Content } = Astro.props.email const { Content } = Astro.props.email
const { title } = Astro.props.email.frontmatter
--- ---
<Content /> <Layout title={title}>
<Content />
</Layout>

View file

@ -1,7 +1,7 @@
--- ---
import PageLayout from '../../layouts/PageLayout.astro' 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 const sortedEmails = emails
.sort((a, b) => .sort((a, b) =>