1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 06:41:17 -04:00

add getStaticProps types

This commit is contained in:
2022-06-30 20:56:34 -04:00
parent 5f22b7989d
commit 887c24d317
17 changed files with 67 additions and 50 deletions

View File

@@ -69,8 +69,14 @@ const Note = ({ frontMatter, source }: NoteWithSource) => {
);
};
export const getStaticProps: GetStaticProps = async ({ params }) => {
const { frontMatter, source } = await compileNote((params as Pick<NoteFrontMatter, "slug">).slug);
export const getStaticProps: GetStaticProps<NoteWithSource, Pick<NoteFrontMatter, "slug">> = async ({ params }) => {
if (!params || !params.slug) {
return {
notFound: true,
};
}
const { frontMatter, source } = await compileNote(params.slug);
return {
props: {