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

@ -21,12 +21,13 @@
</v-list-item-action>
</v-list-item>
<!-- link :to="category.path">{{ category.title }}-->
<!-- by category -->
<v-list-group v-for="(category,c) in categories" :key="c"
:value="active_category.title === category.title" active-class="isactive">
<template v-slot:activator>
<v-list-item-content>
<v-list-item-title link :to="category.path">{{ category.title }}</v-list-item-title>
<v-list-item-content @click="$nuxt.$router.push({path: category.path})">
<v-list-item-title>{{ category.title }}</v-list-item-title>
</v-list-item-content>
</template>

View File

@ -37,13 +37,15 @@ export default {
getTopic(route, categories, active_category) {
let active_topic = active_category.summary_topic;
if (!route.path) {
active_topic = active_category.topics[0]
} else {
let found_topic = active_category.topics.find(x => {return x.path === route.path})
if (found_topic) {
active_topic = found_topic;
}
if (route.path) {
let found_topic = active_category.topics.find(x => {
return x.path === route.path
})
let found_index = active_category.topics.find(x => {
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;

View File

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