Skip to content

Commit

Permalink
fix: better support aside logic based on tree
Browse files Browse the repository at this point in the history
Resolves #836
  • Loading branch information
Atinux committed Mar 8, 2023
1 parent 1dcb26c commit a996854
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 94 deletions.
7 changes: 3 additions & 4 deletions components/docs/DocsPageLayout.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
const { page, navigation } = useContent()
const { config } = useDocus()
const { page } = useContent()
const { config, tree } = useDocus()
const route = useRoute()
const fallbackValue = (value: string, fallback = true) => {
Expand All @@ -11,8 +11,7 @@ const fallbackValue = (value: string, fallback = true) => {
const hasBody = computed(() => !page.value || page.value?.body?.children?.length > 0)
const hasToc = computed(() => page.value?.toc !== false && page.value?.body?.toc?.links?.length >= 2)
// TODO: get navigation links from aside level
const hasAside = computed(() => page.value?.aside !== false && navigation.value?.length > 1)
const hasAside = computed(() => page.value?.aside !== false && tree.value?.length > 1)
const bottom = computed(() => fallbackValue('bottom', true))
const isOpen = ref(false)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -30,7 +30,7 @@
"@nuxt-themes/elements": "^0.9.0",
"@nuxt-themes/tokens": "^1.9.0",
"@nuxt-themes/typography": "^0.9.1",
"@nuxt/content": "^2.5.0",
"@nuxt/content": "^2.5.2",
"@nuxthq/studio": "^0.8.2",
"@vueuse/nuxt": "^9.13.0"
},
Expand Down
151 changes: 62 additions & 89 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a996854

Please sign in to comment.