docs: disable documentDriven mode

This commit is contained in:
Benjamin Canac
2023-06-15 18:18:17 +02:00
parent c8e6ed8df9
commit e2f7d82d62
11 changed files with 84 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
<script setup>
const commandPaletteRef = ref()
const { navigation } = useContent()
const navigation = inject('navigation')
const { data: files } = await useLazyAsyncData('search', () => queryContent().where({ _type: 'markdown' }).find(), { default: () => [] })

View File

@@ -32,7 +32,7 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
const { navigation } = useContent() as { navigation: NavItem[] }
const navigation: Ref<NavItem[]> = inject('navigation')
function mapContentLinks (links: NavItem[]) {
return links?.map(link => ({ label: link.title, icon: link.icon, to: link._path, badge: link.badge })) || []

View File

@@ -13,5 +13,10 @@
</template>
<script setup lang="ts">
const { page } = useContent()
defineProps({
page: {
type: Object,
default: null
}
})
</script>

View File

@@ -33,5 +33,10 @@
</template>
<script setup lang="ts">
const { page } = useContent()
defineProps({
page: {
type: Object,
default: null
}
})
</script>

View File

@@ -1,11 +1,17 @@
<template>
<div class="grid gap-6 sm:grid-cols-2">
<DocsPrevNextCard v-if="prev" :title="prev.navigation?.title || prev.title" :description="prev.navigation?.description || prev.description" :to="prev._path" icon="i-heroicons-arrow-left-20-solid" />
<DocsPrevNextCard
v-if="prev"
:title="prev.title"
:description="prev.description"
:to="prev._path"
icon="i-heroicons-arrow-left-20-solid"
/>
<span v-else class="hidden sm:block">&nbsp;</span>
<DocsPrevNextCard
v-if="next"
:title="next.navigation?.title || next.title"
:description="next.navigation?.description || next.description"
:title="next.title"
:description="next.description"
:to="next._path"
icon="i-heroicons-arrow-right-20-solid"
class="text-right"
@@ -14,5 +20,14 @@
</template>
<script setup lang="ts">
const { prev, next } = useContent()
defineProps({
prev: {
type: Object,
default: null
},
next: {
type: Object,
default: null
}
})
</script>

View File

@@ -23,9 +23,11 @@
</template>
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { Command } from '../../../src/runtime/types'
const { navigation } = useContent()
const navigation: Ref<NavItem[]> = inject('navigation')
const router = useRouter()
const { usingInput } = useShortcuts()
const { isSearchModalOpen } = useDocs()

View File

@@ -13,7 +13,12 @@
</template>
<script setup lang="ts">
const { toc } = useContent()
defineProps({
toc: {
type: Object,
default: null
}
})
const isTocOpen = ref(false)
</script>