mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -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)
|
||||
await fs.writeFile(appListPath, JSON.stringify(appList))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
|
|
@ -43,10 +43,28 @@ export default {
|
|||
const appList = importedAppList.default
|
||||
// console.log('appList', appList)
|
||||
|
||||
return appList.map(app => ({
|
||||
const appRoutes = appList.map(app => ({
|
||||
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