Skip to content

Commit

Permalink
feat: 添加book page 的generateStaticParams
Browse files Browse the repository at this point in the history
  • Loading branch information
luobin committed Aug 21, 2024
1 parent 0c89b22 commit 0fcc672
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/book/[page]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const getPageUrl = (eid, chapter, page, domain = 'https://www.langrenxiaoshuo.co
return domain + eid + '/' + chapter + '_' + page + '.html'
}

export const generateStaticParams = async () => {
const totalPages = 24
const paths = Array.from({ length: totalPages }, (_, i) => ({ page: (i + 1).toString() }))
return paths
}

export default async function BookIndexPage(req) {
const params = req.params
const data = await getContent(req.searchParams.url)
Expand Down

0 comments on commit 0fcc672

Please sign in to comment.