diff options
Diffstat (limited to 'website/src/pages')
| -rw-r--r-- | website/src/pages/blog/[...slug].astro | 8 | ||||
| -rw-r--r-- | website/src/pages/blog/rss.xml.ts | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/website/src/pages/blog/[...slug].astro b/website/src/pages/blog/[...slug].astro index 800c534..0754ea7 100644 --- a/website/src/pages/blog/[...slug].astro +++ b/website/src/pages/blog/[...slug].astro @@ -1,20 +1,20 @@ --- -import { type CollectionEntry, getCollection } from 'astro:content'; +import { type CollectionEntry, getCollection, render } from 'astro:content'; import BlogPost from '../../layouts/BlogPost.astro'; export async function getStaticPaths() { const posts = await getCollection('blog'); return posts.map((post) => ({ - params: { slug: post.slug }, + params: { slug: post.id }, props: post, })); } type Props = CollectionEntry<'blog'>; const post = Astro.props; -const { Content } = await post.render(); +const { Content } = await render(post); --- <BlogPost {...post.data}> <Content /> -</BlogPost>
\ No newline at end of file +</BlogPost> diff --git a/website/src/pages/blog/rss.xml.ts b/website/src/pages/blog/rss.xml.ts index afd0640..5b90fd0 100644 --- a/website/src/pages/blog/rss.xml.ts +++ b/website/src/pages/blog/rss.xml.ts @@ -23,9 +23,9 @@ export async function GET(context: APIContext) { site: path.join(site.toString(), 'blog'), trailingSlash: false, items: posts.map((post) => ({ - link: `/blog/${post.slug}`, + link: `/blog/${post.id}`, title: post.data.title, - content: mdParser.render(post.body), + content: mdParser.render(post.body ?? ''), pubDate: post.data.pubDate, description: post.data.description, author: 'Joe Carstairs', |
