mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
page
This commit is contained in:
parent
053216b891
commit
c70071bd88
1 changed files with 17 additions and 17 deletions
|
|
@ -14,23 +14,23 @@ export default function Page({ projects, itemCount, currentPage }) {
|
|||
)
|
||||
}
|
||||
|
||||
// export async function getStaticProps(context) {
|
||||
// const currentPage = parseInt(context.params.page)
|
||||
// const allProjects = await getAllOnboardProjects()
|
||||
// const data = allProjects.slice((currentPage - 1) * 10, currentPage * 10)
|
||||
// const projects = []
|
||||
// for (const project of data) {
|
||||
// projects.push(await getOnboardProject(project.name))
|
||||
// }
|
||||
// return {
|
||||
// props: {
|
||||
// projects,
|
||||
// itemCount: allProjects.length,
|
||||
// currentPage
|
||||
// },
|
||||
// revalidate: 120 // 2 minutes
|
||||
// }
|
||||
// }
|
||||
export async function getStaticProps(context) {
|
||||
const currentPage = parseInt(context.params.page)
|
||||
const allProjects = await getAllOnboardProjects()
|
||||
const data = allProjects.slice((currentPage - 1) * 10, currentPage * 10)
|
||||
const projects = []
|
||||
for (const project of data) {
|
||||
projects.push(await getOnboardProject(project.name))
|
||||
}
|
||||
return {
|
||||
props: {
|
||||
projects,
|
||||
itemCount: allProjects.length,
|
||||
currentPage
|
||||
},
|
||||
revalidate: 120 // 2 minutes
|
||||
}
|
||||
}
|
||||
|
||||
// export async function getStaticPaths(_context) {
|
||||
// const projectCount = await onboardProjectCount()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue