docs: fix typo in dynamic routing example (#2515)

pull/2519/head
Pavel Horal 2 years ago committed by GitHub
parent 656df5c761
commit 5013835f51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -327,17 +327,15 @@ Instead, you can pass such content to each page using the `content` property on
```js
export default {
paths() {
async paths() {
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
async paths() {
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
return posts.map((post) => {
return {
params: { id: post.id },
content: post.content // raw Markdown or HTML
}
})
}
return posts.map((post) => {
return {
params: { id: post.id },
content: post.content // raw Markdown or HTML
}
})
}
}
```

Loading…
Cancel
Save