Skip to content

Commit

Permalink
feat(#150): add API docs NuxtContent page
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 21, 2021
1 parent c39d75f commit 1e611a3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/pages/api/_.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<NuxtContent :document="document" />
</template>

<script>
export default {
async asyncData({ $content, params, error }) {
let document
try {
document = await $content('api/', params.pathMatch || 'index').fetch();
} catch (e) {
return error({ message: 'Document not found' })
}
return {
document
}
},
}
</script>

0 comments on commit 1e611a3

Please sign in to comment.