11---
2- import { getCollection } from " astro:content" ;
2+ import { getCollection , render } from " astro:content" ;
33import PostLayout from " ../../layouts/PostLayout.astro" ;
44
55export async function getStaticPaths() {
66 const blogEntries = await getCollection (" blog" );
77 return blogEntries .map ((entry ) => ({
8- params: { slug: entry .slug },
8+ params: { slug: entry .id },
99 props: { entry },
1010 }));
1111}
@@ -16,7 +16,7 @@ interface Props {
1616
1717const { slug } = Astro .params ;
1818const allEntries = await getCollection (" blog" );
19- const entry = allEntries .find ((e ) => e .slug === slug );
19+ const entry = allEntries .find ((e ) => e .id === slug );
2020
2121if (! entry ) {
2222 return Astro .redirect (" /" );
@@ -32,7 +32,9 @@ const normalizeDate = (value: unknown) => {
3232};
3333
3434const findSlideRedirect = async (postEntry : any ) => {
35- const tags = (postEntry .data .tags || []).map ((tag : string ) => tag .toLowerCase ());
35+ const tags = (postEntry .data .tags || []).map ((tag : string ) =>
36+ tag .toLowerCase (),
37+ );
3638 if (! tags .includes (" presentation" )) return null ;
3739
3840 const presentations = await getCollection (" presentations" );
@@ -45,7 +47,7 @@ const findSlideRedirect = async (postEntry: any) => {
4547
4648 if (slideDate === targetDate && slideTitle === targetTitle ) {
4749 const redirects = presentation .data .redirects || [];
48- const redirect = redirects [0 ] || presentation .slug ;
50+ const redirect = redirects [0 ] || presentation .id ;
4951 const normalized = redirect .replace (/ ^ \/ + / , " " );
5052 return ` /${normalized }/ ` ;
5153 }
@@ -59,7 +61,7 @@ if (slideRedirect) {
5961 return Astro .redirect (slideRedirect , 302 );
6062}
6163
62- const { Content } = await entry . render ();
64+ const { Content } = await render (entry );
6365---
6466
6567<PostLayout
0 commit comments