docus 4.1.4 → 5.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/app/app.config.ts +0 -2
- package/app/app.vue +8 -14
- package/app/components/docs/DocsPageHeaderLinks.vue +2 -2
- package/app/error.vue +4 -4
- package/app/layouts/default.vue +29 -0
- package/app/pages/[[lang]]/[...slug].vue +0 -8
- package/content.config.ts +0 -1
- package/i18n/locales/be.json +23 -0
- package/i18n/locales/pl.json +23 -0
- package/i18n/locales/ru.json +23 -0
- package/modules/css.ts +3 -3
- package/nuxt.config.ts +1 -1
- package/package.json +15 -15
- package/app/layouts/docs.vue +0 -15
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({
|
|
@@ -33,7 +33,7 @@ useSeoMeta({
|
|
|
33
33
|
|
|
34
34
|
if (isEnabled.value) {
|
|
35
35
|
const route = useRoute()
|
|
36
|
-
const defaultLocale = useRuntimeConfig().public.i18n.defaultLocale
|
|
36
|
+
const defaultLocale = useRuntimeConfig().public.i18n.defaultLocale!
|
|
37
37
|
onMounted(() => {
|
|
38
38
|
const currentLocale = route.path.split('/')[1]
|
|
39
39
|
if (!locales.some(locale => locale.code === currentLocale)) {
|
|
@@ -58,18 +58,12 @@ 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
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<NuxtLayout>
|
|
68
|
-
<NuxtPage />
|
|
69
|
-
</NuxtLayout>
|
|
70
|
-
</UMain>
|
|
71
|
-
|
|
72
|
-
<AppFooter />
|
|
64
|
+
<NuxtLayout>
|
|
65
|
+
<NuxtPage />
|
|
66
|
+
</NuxtLayout>
|
|
73
67
|
|
|
74
68
|
<ClientOnly>
|
|
75
69
|
<LazyUContentSearch
|
|
@@ -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,
|
|
@@ -32,7 +32,7 @@ useSeoMeta({
|
|
|
32
32
|
|
|
33
33
|
if (isEnabled.value) {
|
|
34
34
|
const route = useRoute()
|
|
35
|
-
const defaultLocale = useRuntimeConfig().public.i18n.defaultLocale
|
|
35
|
+
const defaultLocale = useRuntimeConfig().public.i18n.defaultLocale!
|
|
36
36
|
onMounted(() => {
|
|
37
37
|
const currentLocale = route.path.split('/')[1]
|
|
38
38
|
if (!locales.some(locale => locale.code === currentLocale)) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ContentNavigationItem } from '@nuxt/content'
|
|
3
|
+
|
|
4
|
+
const route = useRoute()
|
|
5
|
+
const docsNavigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
6
|
+
const docsLink = computed(() => docsNavigation?.value.flatMap(item => item.children || [item]) || [])
|
|
7
|
+
const isDocs = computed(() => docsLink.value.findIndex(item => item.path === route.path) !== -1)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<AppHeader />
|
|
12
|
+
<UMain>
|
|
13
|
+
<slot v-if="!isDocs" />
|
|
14
|
+
<UContainer v-else>
|
|
15
|
+
<UPage>
|
|
16
|
+
<template #left>
|
|
17
|
+
<UPageAside>
|
|
18
|
+
<DocsAsideLeftTop />
|
|
19
|
+
|
|
20
|
+
<DocsAsideLeftBody />
|
|
21
|
+
</UPageAside>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<slot />
|
|
25
|
+
</UPage>
|
|
26
|
+
</UContainer>
|
|
27
|
+
</UMain>
|
|
28
|
+
<AppFooter />
|
|
29
|
+
</template>
|
|
@@ -4,10 +4,6 @@ import type { ContentNavigationItem, Collections, DocsCollectionItem } from '@nu
|
|
|
4
4
|
import { findPageHeadline } from '@nuxt/content/utils'
|
|
5
5
|
import { addPrerenderPath } from '../../utils/prerender'
|
|
6
6
|
|
|
7
|
-
definePageMeta({
|
|
8
|
-
layout: 'docs',
|
|
9
|
-
})
|
|
10
|
-
|
|
11
7
|
const route = useRoute()
|
|
12
8
|
const { locale, isEnabled, t } = useDocusI18n()
|
|
13
9
|
const appConfig = useAppConfig()
|
|
@@ -28,10 +24,6 @@ if (!page.value) {
|
|
|
28
24
|
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
if (page.value.layout) {
|
|
32
|
-
setPageLayout(page.value.layout as never)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
27
|
// Add the page path to the prerender list
|
|
36
28
|
addPrerenderPath(`/raw${route.path}.md`)
|
|
37
29
|
|
package/content.config.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"common": {
|
|
3
|
+
"or": "або",
|
|
4
|
+
"error": {
|
|
5
|
+
"title": "Старонка не знойдзена",
|
|
6
|
+
"description": "Прабачце, але старонка, якую вы шукаеце, не знойдзена."
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"docs": {
|
|
10
|
+
"copy": {
|
|
11
|
+
"page": "Скапіраваць старонку",
|
|
12
|
+
"link": "Скапіраваць Markdown-старонку",
|
|
13
|
+
"view": "Праглядзець як Markdown",
|
|
14
|
+
"gpt": "Адкрыць у ChatGPT",
|
|
15
|
+
"claude": "Адкрыць у Claude"
|
|
16
|
+
},
|
|
17
|
+
"links": "Супольнасць",
|
|
18
|
+
"toc": "На гэтай старонцы",
|
|
19
|
+
"report": "Паведаміць пра праблему",
|
|
20
|
+
"edit": "Рэдагаваць гэтую старонку"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"common": {
|
|
3
|
+
"or": "lub",
|
|
4
|
+
"error": {
|
|
5
|
+
"title": "Nie znaleziono strony",
|
|
6
|
+
"description": "Przepraszamy, ale nie znaleziono tej strony."
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"docs": {
|
|
10
|
+
"copy": {
|
|
11
|
+
"page": "Skopiuj stronę",
|
|
12
|
+
"link": "Skopiuj stronę Markdown",
|
|
13
|
+
"view": "Wyświetl jako Markdown",
|
|
14
|
+
"gpt": "Otwórz w ChatGPT",
|
|
15
|
+
"claude": "Otwórz w Claude"
|
|
16
|
+
},
|
|
17
|
+
"links": "Społeczność",
|
|
18
|
+
"toc": "Na tej stronie",
|
|
19
|
+
"report": "Zgłoś problem",
|
|
20
|
+
"edit": "Edytuj tę stronę"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"common": {
|
|
3
|
+
"or": "или",
|
|
4
|
+
"error": {
|
|
5
|
+
"title": "Страница не найдена",
|
|
6
|
+
"description": "Извините, но запрашиваемая страница не найдена."
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"docs": {
|
|
10
|
+
"copy": {
|
|
11
|
+
"page": "Копировать страницу",
|
|
12
|
+
"link": "Копировать Markdown-страницу",
|
|
13
|
+
"view": "Просмотреть как Markdown",
|
|
14
|
+
"gpt": "Открыть в ChatGPT",
|
|
15
|
+
"claude": "Открыть в Claude"
|
|
16
|
+
},
|
|
17
|
+
"links": "Сообщество",
|
|
18
|
+
"toc": "На этой странице",
|
|
19
|
+
"report": "Сообщить о проблеме",
|
|
20
|
+
"edit": "Редактировать эту страницу"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
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, '/')}/**/*";
|
|
@@ -27,6 +27,6 @@ export default defineNuxtModule({
|
|
|
27
27
|
},
|
|
28
28
|
})
|
|
29
29
|
|
|
30
|
-
nuxt.options.css.
|
|
30
|
+
nuxt.options.css.unshift(cssTemplate.dst)
|
|
31
31
|
},
|
|
32
32
|
})
|
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.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
7
7
|
"repository": {
|
|
@@ -22,27 +22,27 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@iconify-json/lucide": "^1.2.
|
|
26
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
27
|
-
"@iconify-json/vscode-icons": "^1.2.
|
|
28
|
-
"@nuxt/content": "^3.
|
|
25
|
+
"@iconify-json/lucide": "^1.2.68",
|
|
26
|
+
"@iconify-json/simple-icons": "^1.2.53",
|
|
27
|
+
"@iconify-json/vscode-icons": "^1.2.30",
|
|
28
|
+
"@nuxt/content": "^3.7.1",
|
|
29
29
|
"@nuxt/image": "^1.11.0",
|
|
30
|
-
"@nuxt/kit": "^4.
|
|
31
|
-
"@nuxt/ui
|
|
32
|
-
"@nuxtjs/i18n": "^10.0
|
|
33
|
-
"@nuxtjs/mdc": "^0.17.
|
|
34
|
-
"@nuxtjs/robots": "^5.
|
|
35
|
-
"@vueuse/core": "^13.
|
|
30
|
+
"@nuxt/kit": "^4.1.2",
|
|
31
|
+
"@nuxt/ui": "^4.0.0",
|
|
32
|
+
"@nuxtjs/i18n": "^10.1.0",
|
|
33
|
+
"@nuxtjs/mdc": "^0.17.4",
|
|
34
|
+
"@nuxtjs/robots": "^5.5.5",
|
|
35
|
+
"@vueuse/core": "^13.9.0",
|
|
36
36
|
"defu": "^6.1.4",
|
|
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.1",
|
|
41
41
|
"nuxt-llms": "^0.1.3",
|
|
42
|
-
"nuxt-og-image": "^5.1.
|
|
43
|
-
"pkg-types": "^2.
|
|
42
|
+
"nuxt-og-image": "^5.1.11",
|
|
43
|
+
"pkg-types": "^2.3.0",
|
|
44
44
|
"scule": "^1.3.0",
|
|
45
|
-
"tailwindcss": "^4.1.
|
|
45
|
+
"tailwindcss": "^4.1.13",
|
|
46
46
|
"ufo": "^1.6.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|