2022-10-09 16:18:24 -05:00
|
|
|
<template>
|
|
|
|
<div class="w-screen h-screen max-w-full max-h-screen text-white bg-gradient overflow-hidden">
|
|
|
|
<div id="guides-sidebar" class="hidden md:block fixed top-0 left-0 h-full bg-primary border-r border-white border-opacity-25">
|
|
|
|
<div class="flex justify-center items-center py-4 mb-6">
|
|
|
|
<nuxt-link to="/" class="h-12 w-12 -ml-4">
|
|
|
|
<img src="/Logo48.png" class="h-full w-full" />
|
|
|
|
</nuxt-link>
|
|
|
|
<nuxt-link to="/" class="text-2xl pl-2 sm:pl-4 font-book hover:underline">audiobookshelf</nuxt-link>
|
|
|
|
</div>
|
2022-10-09 17:07:50 -05:00
|
|
|
<nuxt-link v-for="item in content" :key="item.slug" :to="item.fullpath" class="px-4 py-1.5 text-sm font-semibold block mr-6 mb-2" :class="item.fullpath === routePath ? 'bg-white bg-opacity-10 rounded-r-full text-yellow-400' : 'text-gray-300 hover:text-white'">{{ item.title }}</nuxt-link>
|
2022-10-09 16:18:24 -05:00
|
|
|
</div>
|
2022-12-24 11:04:20 -06:00
|
|
|
<div id="guides-content" class="overflow-y-auto max-w-full overflow-x-hidden" style="scrollbar-gutter: stable">
|
|
|
|
<div class="w-full max-w-5xl mx-auto px-2 py-8">
|
2024-01-05 13:53:02 -07:00
|
|
|
|
|
|
|
<header-PageHeader></header-PageHeader>
|
2022-10-09 16:18:24 -05:00
|
|
|
|
2022-12-24 11:04:20 -06:00
|
|
|
<Nuxt />
|
|
|
|
</div>
|
2022-10-09 16:18:24 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
async fetch() {
|
2024-01-05 15:55:51 -07:00
|
|
|
this.fetchContent();
|
2022-10-09 16:18:24 -05:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2024-01-05 13:53:02 -07:00
|
|
|
content: []
|
2022-10-09 16:18:24 -05:00
|
|
|
}
|
|
|
|
},
|
2024-01-05 15:55:51 -07:00
|
|
|
watch: {
|
|
|
|
'$route'(to, from) {
|
|
|
|
this.fetchContent()
|
|
|
|
}
|
|
|
|
},
|
2022-10-09 16:18:24 -05:00
|
|
|
computed: {
|
2022-10-09 17:07:50 -05:00
|
|
|
routePath() {
|
2022-10-09 17:13:37 -05:00
|
|
|
const routePath = this.$route.path || ''
|
|
|
|
return routePath.replace(/\/$/, '')
|
2022-10-09 16:18:24 -05:00
|
|
|
}
|
|
|
|
},
|
2024-01-05 15:55:51 -07:00
|
|
|
methods: {
|
|
|
|
async fetchContent() {
|
|
|
|
if (this.$route.name === 'guides-id') {
|
|
|
|
this.content = await this.$content('guides').fetch()
|
2024-01-05 16:12:23 -07:00
|
|
|
} else if (this.$route.name === 'faq-id') {
|
|
|
|
this.content = await this.$content('faq').fetch()
|
2024-01-05 15:55:51 -07:00
|
|
|
} else {
|
2024-01-05 18:03:39 -07:00
|
|
|
this.content = []
|
2024-01-05 15:55:51 -07:00
|
|
|
}
|
|
|
|
this.content.sort((a, b) => Number(a.order) - Number(b.order))
|
|
|
|
if (process.env.NODE_ENV === 'development') console.log('CONTENT', this.content)
|
|
|
|
}
|
|
|
|
},
|
2022-10-09 16:18:24 -05:00
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
:root {
|
|
|
|
--guides-sidebar-width: 280px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#guides-sidebar {
|
|
|
|
width: var(--guides-sidebar-width);
|
|
|
|
}
|
|
|
|
#guides-content {
|
|
|
|
margin-left: var(--guides-sidebar-width);
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
@media (max-width: 767px) {
|
|
|
|
#guides-content {
|
|
|
|
margin-left: 0px;
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
}
|
2023-01-23 23:33:14 +01:00
|
|
|
</style>
|