This commit is contained in:
belle 2024-06-14 09:19:00 -04:00 committed by Max Wofford
parent 30b1cfaeda
commit 053216b891

View file

@ -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()