Skip to content

Commit

Permalink
feat(#542): use druxt-router for guide content
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 23, 2022
1 parent 45156df commit 39318ca
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions docs/nuxt/pages/guide/_.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
<template>
<div>
<!-- TODO: Add breadcrumb / path -->
<NuxtContent
v-if="document"
<!-- @TODO: Add breadcrumb / path -->
<!-- @TODO: Multilingual content support -->
<DruxtRouter
class="prose prose-sm sm:prose lg:prose-lg xl:prose-xl"
:document="document"
:path="`/en${$route.fullPath}`"
/>
</div>
</template>

<script>
export default {
name: "AppGuideDocument",
async asyncData({ $content, error, params, store, route }) {
const path = params.pathMatch || "README";
let response;
try {
response = await $content("guide/", params.pathMatch || "README").fetch();
} catch (e) {
return error({ message: "Document not found" });
}
store.commit("addRecent", { text: response.title, to: route.path });
return { document: response, path };
},
head() {
return {
title: this.document.title,
};
},
};
</script>

0 comments on commit 39318ca

Please sign in to comment.