docus 4.2.0 → 5.0.1
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/app/app.config.ts +0 -2
- package/app/app.vue +4 -4
- package/app/components/app/AppFooterRight.vue +1 -1
- package/app/components/app/AppHeader.vue +1 -1
- package/app/components/docs/DocsPageHeaderLinks.vue +2 -2
- package/app/error.vue +3 -3
- package/app/layouts/default.vue +2 -1
- package/app/pages/[[lang]]/[...slug].vue +8 -6
- package/app/types/index.d.ts +1 -1
- package/app/utils/navigation.ts +7 -0
- package/modules/css.ts +2 -2
- package/nuxt.config.ts +1 -1
- package/package.json +4 -4
package/app/app.config.ts
CHANGED
package/app/app.vue
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { PageCollections } from '@nuxt/content'
|
|
3
|
-
import * as
|
|
3
|
+
import * as nuxtUiLocales from '@nuxt/ui/locale'
|
|
4
4
|
|
|
5
5
|
const { seo } = useAppConfig()
|
|
6
6
|
const site = useSiteConfig()
|
|
7
7
|
const { locale, locales, isEnabled, switchLocalePath } = useDocusI18n()
|
|
8
8
|
|
|
9
|
-
const lang = computed(() =>
|
|
10
|
-
const dir = computed(() =>
|
|
9
|
+
const lang = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.code || 'en')
|
|
10
|
+
const dir = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.dir || 'ltr')
|
|
11
11
|
const collectionName = computed(() => isEnabled.value ? `docs_${locale.value}` : 'docs')
|
|
12
12
|
|
|
13
13
|
useHead({
|
|
@@ -58,7 +58,7 @@ provide('navigation', navigation)
|
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
60
|
<template>
|
|
61
|
-
<UApp :locale="
|
|
61
|
+
<UApp :locale="nuxtUiLocales[locale as keyof typeof nuxtUiLocales]">
|
|
62
62
|
<NuxtLoadingIndicator color="var(--ui-primary)" />
|
|
63
63
|
|
|
64
64
|
<NuxtLayout>
|
|
@@ -8,7 +8,7 @@ const links = computed(() => [
|
|
|
8
8
|
'target': '_blank',
|
|
9
9
|
'aria-label': `${key} social link`,
|
|
10
10
|
})),
|
|
11
|
-
appConfig.github
|
|
11
|
+
appConfig.github && appConfig.github.url && {
|
|
12
12
|
'icon': 'i-simple-icons-github',
|
|
13
13
|
'to': appConfig.github.url,
|
|
14
14
|
'target': '_blank',
|
|
@@ -6,7 +6,7 @@ const site = useSiteConfig()
|
|
|
6
6
|
|
|
7
7
|
const { localePath, isEnabled, locales } = useDocusI18n()
|
|
8
8
|
|
|
9
|
-
const links = computed(() => appConfig.github
|
|
9
|
+
const links = computed(() => appConfig.github && appConfig.github.url
|
|
10
10
|
? [
|
|
11
11
|
{
|
|
12
12
|
'icon': 'i-simple-icons-github',
|
|
@@ -42,7 +42,7 @@ async function copyPage() {
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<template>
|
|
45
|
-
<
|
|
45
|
+
<UFieldGroup size="sm">
|
|
46
46
|
<UButton
|
|
47
47
|
:label="t('docs.copy.page')"
|
|
48
48
|
:icon="copied ? 'i-lucide-check' : 'i-lucide-copy'"
|
|
@@ -70,5 +70,5 @@ async function copyPage() {
|
|
|
70
70
|
class="border-l border-muted"
|
|
71
71
|
/>
|
|
72
72
|
</UDropdownMenu>
|
|
73
|
-
</
|
|
73
|
+
</UFieldGroup>
|
|
74
74
|
</template>
|
package/app/error.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NuxtError } from '#app'
|
|
3
3
|
import type { PageCollections } from '@nuxt/content'
|
|
4
|
-
import * as
|
|
4
|
+
import * as nuxtUiLocales from '@nuxt/ui/locale'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
7
7
|
error: NuxtError
|
|
@@ -9,8 +9,8 @@ const props = defineProps<{
|
|
|
9
9
|
|
|
10
10
|
const { locale, locales, isEnabled, t, switchLocalePath } = useDocusI18n()
|
|
11
11
|
|
|
12
|
-
const lang = computed(() =>
|
|
13
|
-
const dir = computed(() =>
|
|
12
|
+
const lang = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.code || 'en')
|
|
13
|
+
const dir = computed(() => nuxtUiLocales[locale.value as keyof typeof nuxtUiLocales]?.dir || 'ltr')
|
|
14
14
|
useHead({
|
|
15
15
|
htmlAttrs: {
|
|
16
16
|
lang,
|
package/app/layouts/default.vue
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ContentNavigationItem } from '@nuxt/content'
|
|
3
|
+
import { flattenNavigation } from '../utils/navigation'
|
|
3
4
|
|
|
4
5
|
const route = useRoute()
|
|
5
6
|
const docsNavigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
6
|
-
const docsLink = computed(() => docsNavigation?.value
|
|
7
|
+
const docsLink = computed(() => flattenNavigation(docsNavigation?.value))
|
|
7
8
|
const isDocs = computed(() => docsLink.value.findIndex(item => item.path === route.path) !== -1)
|
|
8
9
|
</script>
|
|
9
10
|
|
|
@@ -46,16 +46,18 @@ defineOgImageComponent('Docs', {
|
|
|
46
46
|
headline: headline.value,
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
+
const github = computed(() => appConfig.github ? appConfig.github : null)
|
|
50
|
+
|
|
49
51
|
const editLink = computed(() => {
|
|
50
|
-
if (!
|
|
52
|
+
if (!github.value) {
|
|
51
53
|
return
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
return [
|
|
55
|
-
|
|
57
|
+
github.value.url,
|
|
56
58
|
'edit',
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
github.value.branch,
|
|
60
|
+
github.value.rootDir,
|
|
59
61
|
'content',
|
|
60
62
|
`${page.value?.stem}.${page.value?.extension}`,
|
|
61
63
|
].filter(Boolean).join('/')
|
|
@@ -92,7 +94,7 @@ const editLink = computed(() => {
|
|
|
92
94
|
|
|
93
95
|
<USeparator>
|
|
94
96
|
<div
|
|
95
|
-
v-if="
|
|
97
|
+
v-if="github"
|
|
96
98
|
class="flex items-center gap-2 text-sm text-muted"
|
|
97
99
|
>
|
|
98
100
|
<UButton
|
|
@@ -109,7 +111,7 @@ const editLink = computed(() => {
|
|
|
109
111
|
<UButton
|
|
110
112
|
variant="link"
|
|
111
113
|
color="neutral"
|
|
112
|
-
:to="`${
|
|
114
|
+
:to="`${github.url}/issues/new/choose`"
|
|
113
115
|
target="_blank"
|
|
114
116
|
icon="i-lucide-alert-circle"
|
|
115
117
|
:ui="{ leadingIcon: 'size-4' }"
|
package/app/types/index.d.ts
CHANGED
package/modules/css.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default defineNuxtModule({
|
|
|
11
11
|
const resolver = createResolver(import.meta.url)
|
|
12
12
|
|
|
13
13
|
const contentDir = joinURL(dir, 'content')
|
|
14
|
-
const
|
|
14
|
+
const uiPath = resolveModulePath('@nuxt/ui', { from: import.meta.url, conditions: ['style'] })
|
|
15
15
|
const tailwindPath = resolveModulePath('tailwindcss', { from: import.meta.url, conditions: ['style'] })
|
|
16
16
|
const layerDir = resolver.resolve('../app')
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ export default defineNuxtModule({
|
|
|
19
19
|
filename: 'docus.css',
|
|
20
20
|
getContents: () => {
|
|
21
21
|
return `@import ${JSON.stringify(tailwindPath)};
|
|
22
|
-
@import ${JSON.stringify(
|
|
22
|
+
@import ${JSON.stringify(uiPath)};
|
|
23
23
|
|
|
24
24
|
@source "${contentDir.replace(/\\/g, '/')}/**/*";
|
|
25
25
|
@source "${layerDir.replace(/\\/g, '/')}/**/*";
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docus",
|
|
3
3
|
"description": "Nuxt layer for Docus documentation theme",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
7
7
|
"repository": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@iconify-json/lucide": "^1.2.68",
|
|
26
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
26
|
+
"@iconify-json/simple-icons": "^1.2.53",
|
|
27
27
|
"@iconify-json/vscode-icons": "^1.2.30",
|
|
28
28
|
"@nuxt/content": "^3.7.1",
|
|
29
29
|
"@nuxt/image": "^1.11.0",
|
|
30
30
|
"@nuxt/kit": "^4.1.2",
|
|
31
|
-
"@nuxt/ui
|
|
31
|
+
"@nuxt/ui": "^4.0.0",
|
|
32
32
|
"@nuxtjs/i18n": "^10.1.0",
|
|
33
33
|
"@nuxtjs/mdc": "^0.17.4",
|
|
34
34
|
"@nuxtjs/robots": "^5.5.5",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"exsolve": "^1.0.7",
|
|
38
38
|
"git-url-parse": "^16.1.0",
|
|
39
39
|
"minimark": "^0.2.0",
|
|
40
|
-
"motion-v": "^1.7.
|
|
40
|
+
"motion-v": "^1.7.2",
|
|
41
41
|
"nuxt-llms": "^0.1.3",
|
|
42
42
|
"nuxt-og-image": "^5.1.11",
|
|
43
43
|
"pkg-types": "^2.3.0",
|