Skip to content

Commit

Permalink
fix: error on dynamic routes
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosirera committed Sep 23, 2020
1 parent f706b1a commit da5fc1c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ export default {
},
],
},
generate: {
async routes() {
const { $content } = require('@nuxt/content')
const dynamicRoutes = await $content('blog').only(['slug']).fetch()
return dynamicRoutes.map((myRoute) =>
myRoute.slug === '/index' ? '/' : `/blog/${myRoute.slug}`
)
},
},
/*
** Global CSS
*/
Expand Down

0 comments on commit da5fc1c

Please sign in to comment.