2023-07-11 19:19:32 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
const isNavOpen = ref<boolean>(false);
|
2023-09-29 13:30:13 +02:00
|
|
|
const isAsideNavOpen = useState<boolean>('miHub_docs_asideNav_openState', () => false);
|
2023-07-11 19:19:32 +02:00
|
|
|
|
|
|
|
useHead({
|
|
|
|
htmlAttrs: {
|
2023-07-15 12:11:23 +02:00
|
|
|
class: 'scroll-pt-32 lg:scroll-pt-20',
|
2023-07-11 19:19:32 +02:00
|
|
|
},
|
|
|
|
});
|
2023-09-23 20:02:04 +02:00
|
|
|
|
2023-11-25 17:48:16 +01:00
|
|
|
const route = useRoute();
|
2023-09-23 20:02:04 +02:00
|
|
|
const { locale } = useI18n();
|
2023-11-25 17:48:16 +01:00
|
|
|
const navigation = ref();
|
|
|
|
const asideNavKey = ref(0);
|
|
|
|
const { data } = await useAsyncData(`navigation_${locale.value}`, () => fetchContentNavigation(queryContent(`/${locale.value}/docs/`)));
|
|
|
|
navigation.value = data.value;
|
|
|
|
|
|
|
|
watch(locale, async (to) => {
|
|
|
|
console.log('locale changed');
|
|
|
|
const { data } = await useAsyncData(`navigation_${to}`, () => fetchContentNavigation(queryContent(`/${to}/docs/`)));
|
|
|
|
navigation.value = data.value;
|
|
|
|
asideNavKey.value++;
|
|
|
|
});
|
2023-07-11 19:19:32 +02:00
|
|
|
</script>
|
2023-09-23 20:02:04 +02:00
|
|
|
|
2023-07-11 19:19:32 +02:00
|
|
|
<template>
|
|
|
|
<div class="bg-white dark:bg-slate-950">
|
|
|
|
<GNav @toggleNav="isNavOpen = !isNavOpen" :is-open="isNavOpen" :slim="true" :disable-shadow="true" />
|
|
|
|
<div class="main-content">
|
2023-11-13 13:10:30 +01:00
|
|
|
<div class="relative container mx-auto max-w-screen-xl p-6 lg:py-0 grid docs-root pb-12">
|
2023-09-29 13:30:13 +02:00
|
|
|
<div
|
|
|
|
class="fixed top-[7.25rem] left-0 z-20 w-64 pl-6 transition-transform bg-slate-50 dark:bg-slate-900 lg:top-auto lg:bg-transparent dark:lg:bg-transparent lg:pl-0 lg:transform-none lg:relative"
|
|
|
|
:class="isAsideNavOpen ? 'translate-x-0' : '-translate-x-64'"
|
|
|
|
>
|
|
|
|
<div class="lg:sticky lg:top-16 h-[calc(100vh-7.25rem)] lg:h-[calc(100vh-4rem)] overflow-y-scroll border-r border-slate-200 dark:border-slate-700 py-6 pr-3">
|
2023-11-25 17:48:16 +01:00
|
|
|
<DocsAsideNav :links="navigation ?? []" :key="asideNavKey" />
|
2023-09-23 20:16:27 +02:00
|
|
|
</div>
|
2023-09-23 20:02:04 +02:00
|
|
|
</div>
|
2023-10-29 15:05:19 +01:00
|
|
|
<div class="relative">
|
2023-09-29 13:30:13 +02:00
|
|
|
<slot></slot>
|
2023-10-29 15:05:19 +01:00
|
|
|
<div
|
|
|
|
class="fixed top-16 z-10 w-full h-full lg:hidden transition-opacity bg-black"
|
|
|
|
:class="isAsideNavOpen ? 'opacity-70' : 'opacity-0 pointer-events-none'"
|
|
|
|
@click="isAsideNavOpen = false"
|
|
|
|
></div>
|
2023-09-29 13:30:13 +02:00
|
|
|
</div>
|
2023-09-23 20:02:04 +02:00
|
|
|
</div>
|
2023-07-11 19:19:32 +02:00
|
|
|
</div>
|
2023-09-09 08:09:04 +02:00
|
|
|
<GFooter class="bg-slate-100 dark:bg-gray-900" />
|
2023-07-11 19:19:32 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
2023-09-23 20:02:04 +02:00
|
|
|
|
|
|
|
<style scoped>
|
2023-09-24 14:03:39 +02:00
|
|
|
.docs-root {
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
}
|
2023-09-23 20:02:04 +02:00
|
|
|
@screen lg {
|
|
|
|
.docs-root {
|
2023-09-23 20:16:27 +02:00
|
|
|
grid-template-columns: 16rem 1fr;
|
2023-09-23 20:02:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|