diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro index ec86505..8c398a0 100644 --- a/src/pages/[...page].astro +++ b/src/pages/[...page].astro @@ -2,6 +2,7 @@ import Layout from '../layouts/Layout.astro'; import Notes from '../components/Notes.astro'; import { type CollectionEntry, getCollection } from 'astro:content'; +import type { GetStaticPaths } from 'astro'; const base = import.meta.env.BASE_URL; @@ -12,12 +13,12 @@ const base = import.meta.env.BASE_URL; })), {pageSize: 6}); }*/ -export async function getStaticPaths({ paginate }) { +export const getStaticPaths = (async ({ paginate }) => { const notes = (await getCollection('notes')).sort( (a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(), ).filter((note) => (note.data.published)); return paginate(notes, { pageSize: 6 }); -}; +}) satisfies GetStaticPaths; const { page } = Astro.props;