Fixed long-standing TypeScript warning.
This commit is contained in:
parent
be53e75d8b
commit
e5a91acf3b
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue