Skip to content

Commit

Permalink
🐛 修复 [page] 页面 TypeScript 类型检查错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Skywt2003 committed Mar 1, 2024
1 parent daf5e67 commit 348a6cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/blog/[page].astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
export async function getStaticPaths({ paginate }) {
import type { InferGetStaticPropsType, GetStaticPaths } from "astro";
export const getStaticPaths = (async ({ paginate }) => {
const url = new URL("https://blog.skywt.cn/api/posts");
url.search = new URLSearchParams({
page: "1",
Expand All @@ -12,7 +14,9 @@ export async function getStaticPaths({ paginate }) {
const posts = data.data.dataSet;
return paginate(posts, { pageSize: 10 });
}
}) satisfies GetStaticPaths;
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
const { page } = Astro.props;
Expand Down

0 comments on commit 348a6cf

Please sign in to comment.