Dynamic Routes
Generate multiple pages from a single markdown template using paths loader files
Basic Setup
.
└─ packages/
├─ [pkg].md # Route template
└─ [pkg].paths.js # Paths loader// packages/[pkg].paths.js
export default {
paths() {
return [
{ params: { pkg: 'foo' }},
{ params: { pkg: 'bar' }},
{ params: { pkg: 'baz' }}
]
}
}Multiple Parameters
Dynamic Path Generation
Accessing Params in Page
Passing Content
Watch Option
Complete Example: Blog
Key Points
Last updated
Was this helpful?