Fix astro check errors on strict typescript, issue #293

This commit is contained in:
prototypa
2023-12-02 09:09:13 -05:00
parent cf40b9d093
commit 788acd9321
7 changed files with 42 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
---
import type { InferGetStaticPropsType, GetStaticPaths } from 'astro';
import { blogCategoryRobots, getStaticPathsBlogCategory } from '~/utils/blog';
import Layout from '~/layouts/PageLayout.astro';
@@ -8,11 +9,13 @@ import Pagination from '~/components/blog/Pagination.astro';
export const prerender = true;
export async function getStaticPaths ({ paginate }) {
export const getStaticPaths = (async ({ paginate }) => {
return await getStaticPathsBlogCategory({ paginate });
}
}) satisfies GetStaticPaths;
const { page, category } = Astro.props;
type Props = InferGetStaticPropsType<typeof getStaticPaths> & { category: string };
const { page, category } = Astro.props as Props;
const currentPage = page.currentPage ?? 1;