Skip to content

Commit

Permalink
chore(#150): update docs components
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 26, 2021
1 parent 9c0dc2b commit c76f3af
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 39 deletions.
28 changes: 27 additions & 1 deletion docs/components/app/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,33 @@
<ul class="menu">
<slot name="title" />
<li v-for="(item, key) of $store.state.menu" :key="key">
<component :is="item.component" class="rounded-btn" v-bind="item.props" v-text="item.text" />
<component
:is="item.component"
class="rounded-btn"
v-bind="item.props"
v-text="item.text"
/>
<ul v-if="children && item.children" class="menu">
<li v-for="(child, childKey) of item.children" :key="childKey">
<component
:is="child.component"
class="rounded-btn"
v-bind="child.props"
v-text="child.text"
/>
</li>
</ul>
</li>
</ul>
</template>

<script>
export default {
props: {
children: {
type: Boolean,
default: false,
},
},
};
</script>
16 changes: 8 additions & 8 deletions docs/components/app/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<template>
<div class="px-1 pt-20 overflow-y-auto w-80 bg-base-100">
<!-- Main menu -->
<AppMenu class="mb-5">
<li slot="title" class="menu-title">
<span>Navigation</span>
</li>
</AppMenu>

<!-- Recent/Pinned documents -->
<!-- Recent documents -->
<ul v-if="$store.state.recent.length" class="mb-5 menu">
<li slot="title" class="menu-title">
<span>Recent documents</span>
Expand All @@ -17,6 +10,13 @@
</li>
</ul>

<!-- Main menu -->
<AppMenu class="mb-5" :children="true">
<li slot="title" class="menu-title">
<span>Navigation</span>
</li>
</AppMenu>

<!-- API menu -->
<ul class="mb-5 menu">
<li slot="title" class="menu-title">
Expand Down
30 changes: 7 additions & 23 deletions docs/components/app/api/Packages.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
<template>
<ul>
<li v-for="item of $store.state.packages" :key="item">
<div>
<div v-for="item of $store.state.packages" :key="item">
<h3 v-text="item" />

<NuxtLink
class="btn btn-secondary"
tag="button"
:to="`/api/packages/${item}/`"
>
Read the docs
<!-- TODO: Add details about package -->

<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="inline-block w-6 h-6 ml-2 stroke-current"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5l7 7-7 7"
/>
</svg>
<NuxtLink class="link" :to="`/api/packages/${item}/`">
Read the docs
</NuxtLink>
</li>
</ul>
</div>
</div>
</template>
6 changes: 6 additions & 0 deletions docs/pages/api/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default {
return { document: response };
},
head() {
return {
title: this.document.title,
};
},
computed: {
module: ({ document }) => document.dir.split("/")[3],
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/api/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import Default from './_.vue'
import Default from "./_.vue";
export default {
extends: Default,
}
};
</script>
8 changes: 7 additions & 1 deletion docs/pages/guide/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
name: "AppGuideDocument",
async asyncData({ $content, error, params, store, route }) {
const path = params.pathMatch || "README"
const path = params.pathMatch || "README";
let response;
try {
response = await $content("guide/", params.pathMatch || "README").fetch();
Expand All @@ -31,5 +31,11 @@ export default {
return { document: response, path };
},
head() {
return {
title: this.document.title,
};
},
};
</script>
4 changes: 2 additions & 2 deletions docs/pages/guide/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import Default from './_.vue'
import Default from "./_.vue";
export default {
extends: Default,
}
};
</script>
4 changes: 2 additions & 2 deletions docs/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<!-- Quote -->
<div class="bg-gray-200 p-10">
<div class="prose prose-lg mx-auto">
<blockquote v-text="quote" />
<div class="container mx-auto text-center">
<blockquote class="text-2xl" v-text="quote" />
</div>
</div>

Expand Down

0 comments on commit c76f3af

Please sign in to comment.