mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Fix passing props at wrong level
This commit is contained in:
parent
1c7d7c4fe0
commit
66315cfc40
1 changed files with 19 additions and 8 deletions
|
|
@ -36,14 +36,20 @@ export async function getStaticProps({ params }) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const allEndpointListings = await fs.readFile('./static/eleventy-endpoints.json', 'utf-8')
|
// const allEndpointListings = await fs.readFile('./static/eleventy-endpoints.json', 'utf-8')
|
||||||
.then( endpointsJson => {
|
// .then( endpointsJson => {
|
||||||
return JSON.parse(endpointsJson)
|
// return JSON.parse(endpointsJson)
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
const allEndpointListings = await fs.stat('./static/eleventy-endpointsdddd.json')
|
||||||
|
const currentDirectory = await fs.readdir('./')
|
||||||
|
|
||||||
// console.log('endpointListings', endpointListings[0])
|
// console.log('endpointListings', endpointListings[0])
|
||||||
|
|
||||||
let pageListing = { allEndpointListings }
|
let pageListing = {
|
||||||
|
allEndpointListings,
|
||||||
|
currentDirectory
|
||||||
|
}
|
||||||
|
|
||||||
const start = '/formula/'
|
const start = '/formula/'
|
||||||
|
|
||||||
|
|
@ -64,13 +70,18 @@ export async function getStaticProps({ params }) {
|
||||||
console.log('pageListing', pageListing)
|
console.log('pageListing', pageListing)
|
||||||
|
|
||||||
return pageListing ? {
|
return pageListing ? {
|
||||||
props: pageListing,
|
props: {
|
||||||
...defaultStaticProps
|
...pageListing
|
||||||
|
},
|
||||||
|
revalidate: ONE_MINUTE
|
||||||
} : { notFound: true }
|
} : { notFound: true }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// The Twitter API most likely died
|
// The Twitter API most likely died
|
||||||
console.error(error)
|
console.error(error)
|
||||||
return { notFound: true, error }
|
return {
|
||||||
|
notFound: true,
|
||||||
|
props: { error }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue