Skip to content

Commit 585bd5e

Browse files
author
Pooya Parsa
committed
add generate.routeParams
1 parent 25ce5b3 commit 585bd5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nuxt.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require('path');
2+
const fs = require('fs');
23

34
module.exports = {
45
srcDir: path.resolve(__dirname, 'docs', 'nuxt'),
@@ -33,7 +34,12 @@ module.exports = {
3334
},
3435

3536
generate: {
36-
dir: 'docs-dist'
37+
dir: 'docs-dist',
38+
routeParams: {
39+
'/docs/components/:component': fs.readdirSync('docs/components').filter(c => c !== 'index.js').map(component => {
40+
return {component}
41+
})
42+
}
3743
},
3844

3945
plugins: [

0 commit comments

Comments
 (0)