docus 3.0.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +31 -9
- package/app/app/app.config.ts +33 -0
- package/app/app/app.vue +54 -0
- package/app/app/assets/css/main.css +5 -0
- package/app/app/components/IconMenuToggle.vue +81 -0
- package/app/app/components/OgImage/OgImageDocs.vue +76 -0
- package/app/app/components/OgImage/OgImageLanding.vue +73 -0
- package/app/app/components/app/AppFooter.vue +40 -0
- package/app/app/components/app/AppHeader.vue +57 -0
- package/app/app/components/app/AppHeaderBody.vue +13 -0
- package/{theme/components/globals/Logo.vue → app/app/components/app/AppHeaderCTA.vue} +1 -1
- package/app/app/components/app/AppHeaderCenter.vue +6 -0
- package/app/app/components/app/AppHeaderLogo.vue +16 -0
- package/app/app/components/docs/DocsAsideLeftTop.vue +3 -0
- package/app/app/components/docs/DocsAsideRightBottom.vue +17 -0
- package/app/app/components/docs/DocsPageHeaderLinks.vue +91 -0
- package/app/app/error.vue +42 -0
- package/app/app/layouts/docs.vue +25 -0
- package/app/app/pages/[...slug].vue +111 -0
- package/app/app/pages/index.vue +37 -0
- package/app/content.config.ts +31 -0
- package/app/nuxt.config.ts +41 -0
- package/app/nuxt.schema.ts +255 -0
- package/app/server/routes/raw/[...slug].md.get.ts +24 -0
- package/dist/main.mjs +242 -0
- package/package.json +66 -39
- package/theme/app/router.options.ts +0 -18
- package/theme/assets/css/fonts.css +0 -84
- package/theme/assets/css/main.css +0 -104
- package/theme/components/app/Container.vue +0 -25
- package/theme/components/app/Footer.vue +0 -40
- package/theme/components/app/MobileNav.vue +0 -85
- package/theme/components/app/Navbar.vue +0 -37
- package/theme/components/app/NavbarLogo.vue +0 -33
- package/theme/components/app/Page.vue +0 -7
- package/theme/components/app/PoweredByDocus.vue +0 -11
- package/theme/components/content/Alert.vue +0 -124
- package/theme/components/content/BlockHero.vue +0 -54
- package/theme/components/content/ButtonLink.vue +0 -45
- package/theme/components/content/Card.vue +0 -46
- package/theme/components/content/CardGrid.vue +0 -23
- package/theme/components/content/CodeBlock.vue +0 -47
- package/theme/components/content/CodeGroup.vue +0 -135
- package/theme/components/content/CopyButton.vue +0 -49
- package/theme/components/content/List.vue +0 -5
- package/theme/components/content/NeedContribution.vue +0 -23
- package/theme/components/content/ReadMore.vue +0 -25
- package/theme/components/content/Sandbox.vue +0 -102
- package/theme/components/content/TabsHeader.vue +0 -44
- package/theme/components/content/Terminal.vue +0 -64
- package/theme/components/content/VideoPlayer.vue +0 -115
- package/theme/components/dev/Debug.vue +0 -66
- package/theme/components/docs/DocsAside.vue +0 -21
- package/theme/components/docs/DocsAsideTree.vue +0 -104
- package/theme/components/docs/DocsHero.vue +0 -39
- package/theme/components/docs/DocsPage.vue +0 -21
- package/theme/components/docs/DocsPageContent.vue +0 -32
- package/theme/components/docs/DocsToc.vue +0 -77
- package/theme/components/globals/Icon.vue +0 -24
- package/theme/components/globals/NuxtImg.vue +0 -45
- package/theme/components/globals/SocialIcons.vue +0 -45
- package/theme/components/globals/ThemeSelect.vue +0 -35
- package/theme/components/icons/IconAlgolia.vue +0 -8
- package/theme/components/icons/IconArrowLeft.vue +0 -10
- package/theme/components/icons/IconArrowRight.vue +0 -10
- package/theme/components/icons/IconBadgeCheck.vue +0 -14
- package/theme/components/icons/IconCheck.vue +0 -10
- package/theme/components/icons/IconCheckCircle.vue +0 -10
- package/theme/components/icons/IconChevronRight.vue +0 -12
- package/theme/components/icons/IconClipboardCheck.vue +0 -14
- package/theme/components/icons/IconClipboardCopy.vue +0 -14
- package/theme/components/icons/IconCodeSandbox.vue +0 -8
- package/theme/components/icons/IconCopy.vue +0 -17
- package/theme/components/icons/IconDots.vue +0 -10
- package/theme/components/icons/IconEdit.vue +0 -18
- package/theme/components/icons/IconExclamationCircle.vue +0 -12
- package/theme/components/icons/IconExclamationTriangle.vue +0 -10
- package/theme/components/icons/IconExternalLink.vue +0 -12
- package/theme/components/icons/IconGit.vue +0 -7
- package/theme/components/icons/IconGitHub.vue +0 -10
- package/theme/components/icons/IconHeart.vue +0 -9
- package/theme/components/icons/IconInformationCircle.vue +0 -10
- package/theme/components/icons/IconLighthouse.vue +0 -83
- package/theme/components/icons/IconLine.vue +0 -10
- package/theme/components/icons/IconMarkdown.vue +0 -13
- package/theme/components/icons/IconMenu.vue +0 -12
- package/theme/components/icons/IconMenuAlt.vue +0 -10
- package/theme/components/icons/IconMinus.vue +0 -10
- package/theme/components/icons/IconMoon.vue +0 -10
- package/theme/components/icons/IconNuxt.vue +0 -14
- package/theme/components/icons/IconNuxtContent.vue +0 -20
- package/theme/components/icons/IconNuxtLabs.vue +0 -21
- package/theme/components/icons/IconPlus.vue +0 -10
- package/theme/components/icons/IconPuzzle.vue +0 -8
- package/theme/components/icons/IconSSG.vue +0 -7
- package/theme/components/icons/IconSearch.vue +0 -12
- package/theme/components/icons/IconSun.vue +0 -10
- package/theme/components/icons/IconTailwind.vue +0 -3
- package/theme/components/icons/IconTocBack.vue +0 -21
- package/theme/components/icons/IconTocCurrent.vue +0 -21
- package/theme/components/icons/IconTocNext.vue +0 -8
- package/theme/components/icons/IconTranslate.vue +0 -14
- package/theme/components/icons/IconTwitter.vue +0 -8
- package/theme/components/icons/IconVite.vue +0 -30
- package/theme/components/icons/IconVue.vue +0 -6
- package/theme/components/icons/IconVueTelescope.vue +0 -11
- package/theme/components/icons/IconWindi.vue +0 -17
- package/theme/components/icons/IconX.vue +0 -12
- package/theme/components/icons/IconXCircle.vue +0 -10
- package/theme/components/icons/IconZap.vue +0 -8
- package/theme/components/prose/ProseA.vue +0 -66
- package/theme/components/prose/ProseBlockquote.vue +0 -21
- package/theme/components/prose/ProseCode.vue +0 -67
- package/theme/components/prose/ProseCodeInline.vue +0 -38
- package/theme/components/prose/ProseEm.vue +0 -11
- package/theme/components/prose/ProseH1.vue +0 -22
- package/theme/components/prose/ProseH2.vue +0 -22
- package/theme/components/prose/ProseH3.vue +0 -24
- package/theme/components/prose/ProseH4.vue +0 -24
- package/theme/components/prose/ProseHr.vue +0 -13
- package/theme/components/prose/ProseImg.vue +0 -30
- package/theme/components/prose/ProseLi.vue +0 -31
- package/theme/components/prose/ProseOl.vue +0 -16
- package/theme/components/prose/ProseP.vue +0 -14
- package/theme/components/prose/ProseStrong.vue +0 -14
- package/theme/components/prose/ProseTable.vue +0 -13
- package/theme/components/prose/ProseTbody.vue +0 -5
- package/theme/components/prose/ProseTd.vue +0 -11
- package/theme/components/prose/ProseTh.vue +0 -11
- package/theme/components/prose/ProseThead.vue +0 -11
- package/theme/components/prose/ProseTr.vue +0 -11
- package/theme/components/prose/ProseUl.vue +0 -15
- package/theme/composables/useDocus.ts +0 -43
- package/theme/composables/useMenu.ts +0 -7
- package/theme/composables/useScrollToHeading.ts +0 -35
- package/theme/composables/useScrollspy.ts +0 -46
- package/theme/composables/useUserAgent.ts +0 -7
- package/theme/composables/utils.ts +0 -4
- package/theme/layouts/default.vue +0 -29
- package/theme/layouts/page.vue +0 -19
- package/theme/middleware/components.ts +0 -26
- package/theme/middleware/navigation.global.ts +0 -12
- package/theme/middleware/page.ts +0 -8
- package/theme/middleware/theme.global.ts +0 -12
- package/theme/nuxt.config.ts +0 -171
- package/theme/pages/[...slug].vue +0 -64
- package/theme/plugins/menu.ts +0 -67
- package/theme/plugins/user-agent.ts +0 -27
- package/theme/utils/components.ts +0 -25
- package/theme/utils/navigation.ts +0 -49
- package/theme/utils/plugin.ts +0 -21
- package/theme/utils/queries.ts +0 -68
- package/theme/utils/state.ts +0 -33
- package/theme/utils/theme.ts +0 -66
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps<{ id: string }>()
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<h3 :id="id">
|
|
7
|
-
<NuxtLink :href="`#${id}`">
|
|
8
|
-
<slot />
|
|
9
|
-
</NuxtLink>
|
|
10
|
-
</h3>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<style lang="postcss" scoped>
|
|
14
|
-
h3 {
|
|
15
|
-
/* TODO */
|
|
16
|
-
/* extend.fontSize do not work in Windi */
|
|
17
|
-
font-size: 1.25rem;
|
|
18
|
-
@apply tracking-tight leading-snug font-semibold mt-[1.25em] mb-[0.5em];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
h3 + * {
|
|
22
|
-
@apply mt-0;
|
|
23
|
-
}
|
|
24
|
-
</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps<{ id: string }>()
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<h4 :id="id">
|
|
7
|
-
<NuxtLink :href="`#${id}`">
|
|
8
|
-
<slot />
|
|
9
|
-
</NuxtLink>
|
|
10
|
-
</h4>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<style lang="postcss" scoped>
|
|
14
|
-
h4 {
|
|
15
|
-
/* TODO */
|
|
16
|
-
/* extend.fontSize do not work in Windi */
|
|
17
|
-
font-size: 1.125rem;
|
|
18
|
-
@apply tracking-tight leading-snug font-semibold mt-[1.25em] mb-[0.5em];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
h4 + * {
|
|
22
|
-
@apply mt-0;
|
|
23
|
-
}
|
|
24
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps({
|
|
3
|
-
src: {
|
|
4
|
-
type: String,
|
|
5
|
-
default: '',
|
|
6
|
-
},
|
|
7
|
-
alt: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: '',
|
|
10
|
-
},
|
|
11
|
-
width: {
|
|
12
|
-
type: [String, Number],
|
|
13
|
-
default: undefined,
|
|
14
|
-
},
|
|
15
|
-
height: {
|
|
16
|
-
type: [String, Number],
|
|
17
|
-
default: undefined,
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<NuxtImg :src="src" :alt="alt" :width="width" :height="height" />
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<style lang="postcss" scoped>
|
|
27
|
-
:deep(img) {
|
|
28
|
-
@apply my-[1em];
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<li><slot /></li>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<style lang="postcss" scoped>
|
|
6
|
-
li {
|
|
7
|
-
@apply relative my-[0.25em] pl-4;
|
|
8
|
-
p {
|
|
9
|
-
@apply my-[0.75em];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
ul > li {
|
|
14
|
-
&::before {
|
|
15
|
-
@apply absolute left-0 top-[0.5em] surface-secondary rounded-full w-1.5 h-1.5;
|
|
16
|
-
content: '';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
ol > li {
|
|
21
|
-
&::before {
|
|
22
|
-
@apply absolute left-0 top-0 text-secondary;
|
|
23
|
-
content: counter(list-item, decimal) '.';
|
|
24
|
-
content: counter(list-item, var(--list-counter-style, decimal)) '.';
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:deep(.nuxt-content-highlight) {
|
|
29
|
-
@apply m-0;
|
|
30
|
-
}
|
|
31
|
-
</style>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useDocusState } from '../utils/state'
|
|
2
|
-
import { computed } from '#imports'
|
|
3
|
-
|
|
4
|
-
export const useDocus = () => {
|
|
5
|
-
const { theme, navigation, page, surround } = useDocusState()
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Table of contents from parsed page.
|
|
9
|
-
*/
|
|
10
|
-
const toc = computed(() => page?.value?.body?.toc || [])
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Content type from parsed page.
|
|
14
|
-
*/
|
|
15
|
-
const type = computed(() => page.value?.meta?.type)
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Layout type from parsed page.
|
|
19
|
-
*/
|
|
20
|
-
const layout = computed(() => page.value?.meta?.layout)
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Next page from `surround`.
|
|
24
|
-
*/
|
|
25
|
-
const next = computed(() => surround.value?.[1] || null)
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Previous page from `surround`.
|
|
29
|
-
*/
|
|
30
|
-
const prev = computed(() => surround.value?.[0] || null)
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
theme,
|
|
34
|
-
navigation,
|
|
35
|
-
surround,
|
|
36
|
-
page,
|
|
37
|
-
toc,
|
|
38
|
-
type,
|
|
39
|
-
layout,
|
|
40
|
-
next,
|
|
41
|
-
prev,
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const useConvertPropToPixels = (prop: string): number => {
|
|
2
|
-
const tempDiv = document.createElement('div')
|
|
3
|
-
|
|
4
|
-
tempDiv.style.position = 'absolute'
|
|
5
|
-
tempDiv.style.opacity = '0'
|
|
6
|
-
tempDiv.style.height = getComputedStyle(document.documentElement).getPropertyValue(prop)
|
|
7
|
-
|
|
8
|
-
document.body.appendChild(tempDiv)
|
|
9
|
-
|
|
10
|
-
const pixels = parseInt(getComputedStyle(tempDiv).height)
|
|
11
|
-
|
|
12
|
-
document.body.removeChild(tempDiv)
|
|
13
|
-
|
|
14
|
-
return pixels
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const useScrollToHeading = (id: string, scrollMarginCssVar: string) => {
|
|
18
|
-
// Use replaceState to prevent page jump when adding hash
|
|
19
|
-
history.replaceState({}, '', `#${id}`)
|
|
20
|
-
|
|
21
|
-
// Do not remove setTimeout (does not work in Safari)
|
|
22
|
-
setTimeout(() => {
|
|
23
|
-
const escapedId = id.replace(/\./g, '\\.')
|
|
24
|
-
|
|
25
|
-
const heading = document.querySelector(`#${escapedId}`) as any
|
|
26
|
-
|
|
27
|
-
const offset = heading.offsetTop - useConvertPropToPixels(scrollMarginCssVar)
|
|
28
|
-
|
|
29
|
-
window.scrollTo({
|
|
30
|
-
top: offset,
|
|
31
|
-
left: 0,
|
|
32
|
-
behavior: 'smooth',
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue'
|
|
2
|
-
import { onBeforeMount, onBeforeUnmount, ref, watch } from '#imports'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Scrollspy allows you to watch visible headings in a specific page.
|
|
6
|
-
* Useful for table of contents live style updates.
|
|
7
|
-
*/
|
|
8
|
-
export const useScrollspy = () => {
|
|
9
|
-
const observer = ref() as Ref<IntersectionObserver>
|
|
10
|
-
const visibleHeadings = ref([]) as Ref<string[]>
|
|
11
|
-
const activeHeadings = ref([]) as Ref<string[]>
|
|
12
|
-
|
|
13
|
-
const observerCallback = (entries: IntersectionObserverEntry[]) =>
|
|
14
|
-
entries.forEach((entry) => {
|
|
15
|
-
const id = entry.target.id
|
|
16
|
-
|
|
17
|
-
if (entry.isIntersecting)
|
|
18
|
-
visibleHeadings.value.push(id)
|
|
19
|
-
else
|
|
20
|
-
visibleHeadings.value = visibleHeadings.value.filter(t => t !== id)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const updateHeadings = (headings: Element[]) =>
|
|
24
|
-
headings.forEach((heading) => {
|
|
25
|
-
observer.value.observe(heading)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
watch(visibleHeadings, (val, oldVal) => {
|
|
29
|
-
if (val.length === 0)
|
|
30
|
-
activeHeadings.value = oldVal
|
|
31
|
-
else
|
|
32
|
-
activeHeadings.value = val
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
// Create intersection observer
|
|
36
|
-
onBeforeMount(() => (observer.value = new IntersectionObserver(observerCallback)))
|
|
37
|
-
|
|
38
|
-
// Destroy it
|
|
39
|
-
onBeforeUnmount(() => observer.value?.disconnect())
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
visibleHeadings,
|
|
43
|
-
activeHeadings,
|
|
44
|
-
updateHeadings,
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useDocus } from '#imports'
|
|
3
|
-
|
|
4
|
-
const { theme } = useDocus()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div class="w-full flex min-h-screen flex-col">
|
|
9
|
-
<Debug v-if="theme?.debug" :config="theme?.debug" />
|
|
10
|
-
|
|
11
|
-
<div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col">
|
|
12
|
-
<Navbar />
|
|
13
|
-
|
|
14
|
-
<DocsPage>
|
|
15
|
-
<template #aside>
|
|
16
|
-
<DocsAside />
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<DocsPageContent>
|
|
20
|
-
<div class="max-w-none">
|
|
21
|
-
<NuxtPage />
|
|
22
|
-
</div>
|
|
23
|
-
</DocsPageContent>
|
|
24
|
-
</DocsPage>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<Footer />
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
package/theme/layouts/page.vue
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useDocus } from '#imports'
|
|
3
|
-
|
|
4
|
-
const { theme } = useDocus()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div class="w-full flex min-h-screen flex-col">
|
|
9
|
-
<Debug v-if="theme?.debug" :config="theme?.debug" />
|
|
10
|
-
|
|
11
|
-
<Navbar />
|
|
12
|
-
|
|
13
|
-
<div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col">
|
|
14
|
-
<NuxtPage />
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<Footer />
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { flattenComponents } from '../utils/components'
|
|
2
|
-
import { useDocusState } from '../utils/state'
|
|
3
|
-
import * as Components from '#components'
|
|
4
|
-
import { useNuxtApp } from '#imports'
|
|
5
|
-
|
|
6
|
-
export default defineNuxtRouteMiddleware(
|
|
7
|
-
async () => {
|
|
8
|
-
const { page } = useDocusState()
|
|
9
|
-
const nuxtApp = useNuxtApp()
|
|
10
|
-
|
|
11
|
-
if (page.value) {
|
|
12
|
-
// Components used in page (prose + Vue components)
|
|
13
|
-
const components: string[] = flattenComponents(page.value.body.children)
|
|
14
|
-
|
|
15
|
-
// Preload components before rendering
|
|
16
|
-
for (const name of components) {
|
|
17
|
-
if (!nuxtApp.vueApp.component(name)) {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.log({ name, component: (Components as any)[name] })
|
|
20
|
-
|
|
21
|
-
nuxtApp.vueApp.component(name, (Components as any)[name])
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useDocusState } from '../utils/state'
|
|
2
|
-
import { queryNavigation } from '../utils/queries'
|
|
3
|
-
import { defineNuxtRouteMiddleware } from '#imports'
|
|
4
|
-
|
|
5
|
-
export default defineNuxtRouteMiddleware(
|
|
6
|
-
async () => {
|
|
7
|
-
const { navigation } = useDocusState()
|
|
8
|
-
|
|
9
|
-
if (!navigation.value)
|
|
10
|
-
await queryNavigation()
|
|
11
|
-
},
|
|
12
|
-
)
|
package/theme/middleware/page.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useDocusState } from '../utils/state'
|
|
2
|
-
import { queryTheme } from '../utils/queries'
|
|
3
|
-
import { defineNuxtRouteMiddleware } from '#imports'
|
|
4
|
-
|
|
5
|
-
export default defineNuxtRouteMiddleware(
|
|
6
|
-
async () => {
|
|
7
|
-
const { theme } = useDocusState()
|
|
8
|
-
|
|
9
|
-
if (!theme.value)
|
|
10
|
-
await queryTheme()
|
|
11
|
-
},
|
|
12
|
-
)
|