mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add /kind/ to generated routes
This commit is contained in:
parent
51e1965535
commit
c0d54aa8ce
1 changed files with 21 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ const storeAppList = async function (builder) {
|
||||||
|
|
||||||
// console.log('builder.nuxt.options', builder.nuxt.options)
|
// console.log('builder.nuxt.options', builder.nuxt.options)
|
||||||
await fs.writeFile(appListPath, JSON.stringify(appList))
|
await fs.writeFile(appListPath, JSON.stringify(appList))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -43,10 +43,28 @@ export default {
|
||||||
const appList = importedAppList.default
|
const appList = importedAppList.default
|
||||||
// console.log('appList', appList)
|
// console.log('appList', appList)
|
||||||
|
|
||||||
return appList.map(app => ({
|
const appRoutes = appList.map(app => ({
|
||||||
route: '/app/' + app.slug,
|
route: '/app/' + app.slug,
|
||||||
payload: appList
|
// payload: appList
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
const sectionList = []
|
||||||
|
|
||||||
|
appList.forEach(app => {
|
||||||
|
if (sectionList.includes(app.section.slug)) return
|
||||||
|
|
||||||
|
sectionList.push(app.section.slug)
|
||||||
|
})
|
||||||
|
|
||||||
|
const sectionRoutes = sectionList.map(slug => ({
|
||||||
|
route: '/kind/' + slug,
|
||||||
|
// payload: appList
|
||||||
|
}))
|
||||||
|
|
||||||
|
return [
|
||||||
|
...appRoutes,
|
||||||
|
...sectionRoutes
|
||||||
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue