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 Layout from '../layouts/Layout.astro';
|
||||||
import Notes from '../components/Notes.astro';
|
import Notes from '../components/Notes.astro';
|
||||||
import { type CollectionEntry, getCollection } from 'astro:content';
|
import { type CollectionEntry, getCollection } from 'astro:content';
|
||||||
|
import type { GetStaticPaths } from 'astro';
|
||||||
|
|
||||||
const base = import.meta.env.BASE_URL;
|
const base = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
@ -12,12 +13,12 @@ const base = import.meta.env.BASE_URL;
|
||||||
})), {pageSize: 6});
|
})), {pageSize: 6});
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
export async function getStaticPaths({ paginate }) {
|
export const getStaticPaths = (async ({ paginate }) => {
|
||||||
const notes = (await getCollection('notes')).sort(
|
const notes = (await getCollection('notes')).sort(
|
||||||
(a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(),
|
(a: CollectionEntry<'notes'>, b: CollectionEntry<'notes'>) => b.data.date.valueOf() - a.data.date.valueOf(),
|
||||||
).filter((note) => (note.data.published));
|
).filter((note) => (note.data.published));
|
||||||
return paginate(notes, { pageSize: 6 });
|
return paginate(notes, { pageSize: 6 });
|
||||||
};
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
const { page } = Astro.props;
|
const { page } = Astro.props;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue