restore category linking

This commit is contained in:
Jonathan Shook 2020-09-16 17:04:21 -05:00
parent 520dd6c730
commit a413b49a97
3 changed files with 35 additions and 28 deletions

View File

@ -3,11 +3,11 @@
v-model="isDrawerOpen" v-model="isDrawerOpen"
:permanent="isMenuLocked" :permanent="isMenuLocked"
@transitionend="toggleDrawerOpened" @transitionend="toggleDrawerOpened"
:title="drawerTitle"> :title="drawerTitle">
<div class="menu"> <div class="menu">
<!-- active_category: {{ active_category.name }} active_topic: {{ active_topic.name }}--> <!-- active_category: {{ active_category.name }} active_topic: {{ active_topic.name }}-->
<!-- Use active_category and active_topic to select inactive --> <!-- Use active_category and active_topic to select inactive -->
<v-list nav dense> <v-list nav dense>
@ -21,12 +21,13 @@
</v-list-item-action> </v-list-item-action>
</v-list-item> </v-list-item>
<!-- link :to="category.path">{{ category.title }}-->
<!-- by category --> <!-- by category -->
<v-list-group v-for="(category,c) in categories" :key="c" <v-list-group v-for="(category,c) in categories" :key="c"
:value="active_category.title === category.title" active-class="isactive"> :value="active_category.title === category.title" active-class="isactive">
<template v-slot:activator> <template v-slot:activator>
<v-list-item-content> <v-list-item-content @click="$nuxt.$router.push({path: category.path})">
<v-list-item-title link :to="category.path">{{ category.title }}</v-list-item-title> <v-list-item-title>{{ category.title }}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</template> </template>
@ -59,7 +60,7 @@ export default {
drawerTitle: { drawerTitle: {
get() { get() {
return "category=" + this.active_category.name return "category=" + this.active_category.name
+"\ntopic=" + this.active_topic.name + "\ntopic=" + this.active_topic.name
} }
}, },
isMenuLocked: { isMenuLocked: {

View File

@ -37,13 +37,15 @@ export default {
getTopic(route, categories, active_category) { getTopic(route, categories, active_category) {
let active_topic = active_category.summary_topic; let active_topic = active_category.summary_topic;
if (!route.path) { if (route.path) {
active_topic = active_category.topics[0] let found_topic = active_category.topics.find(x => {
} else { return x.path === route.path
let found_topic = active_category.topics.find(x => {return x.path === route.path}) })
if (found_topic) { let found_index = active_category.topics.find(x => {
active_topic = found_topic; return x.path.match(/\/index(.md)?/)
} });
active_topic = found_topic ? found_topic : found_index ? found_index : active_topic;
console.log("active_topic=" + active_topic.path);
} }
return active_topic; return active_topic;

View File

@ -1,26 +1,30 @@
<template> <template>
<!-- https://github.com/Microsoft/vscode-recipes/tree/master/vuejs-cli --> <div></div>
<div class="container" style="justify-content: center; align-content: center; display: flex; width: 100%; margin-left: unset"> <!-- &lt;!&ndash; https://github.com/Microsoft/vscode-recipes/tree/master/vuejs-cli &ndash;&gt;-->
<!-- <recursive-menu/>--> <!-- <div class="container" style="justify-content: center; align-content: center; display: flex; width: 100%; margin-left: unset">-->
<div style="justify-content: center" align="middle"> <!--&lt;!&ndash; <recursive-menu/>&ndash;&gt;-->
<logo align="middle" style="justify-content: center; align-content: center"></logo> <!-- <div style="justify-content: center" align="middle">-->
<h1 class="title">nosqlbench</h1> <!-- <logo align="middle" style="justify-content: center; align-content: center"></logo>-->
<h2 class="subtitle">open source, pluggable, nosql benchmarking suite</h2> <!-- <h1 class="title">nosqlbench</h1>-->
<div class="links"> <!-- <h2 class="subtitle">open source, pluggable, nosql benchmarking suite</h2>-->
<nuxt-link to="/docs/" class="button--purple">Documentation</nuxt-link> <!-- <div class="links">-->
<a href="https://github.com/nosqlbench/nosqlbench" class="button--purple">Project Site</a> <!-- <nuxt-link to="/docs/" class="button&#45;&#45;purple">Documentation</nuxt-link>-->
</div> <!-- <a href="https://github.com/nosqlbench/nosqlbench" class="button&#45;&#45;purple">Project Site</a>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<!-- </div>-->
</template> </template>
<script> <script>
import Logo from '~/components/Logo.vue' // import Logo from '~/components/Logo.vue'
export default { export default {
components: { middleware({ redirect }) {
Logo return redirect('/docs/')
} }
// components: {
// Logo
// }
} }
</script> </script>