docus 4.1.2 โ†’ 4.1.4

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![npm version](https://img.shields.io/npm/v/docus.svg)](https://www.npmjs.com/package/docus)
8
8
  [![npm downloads](https://img.shields.io/npm/dm/docus.svg)](https://www.npmjs.com/package/docus)
9
9
 
10
- This is the official Nuxt layer for [Docus](https://docus.dev), providing a complete documentation theming. It works with the [Docus CLI](https://github.com/nuxtlabs/docus/tree/main/cli) for rapid project setup.
10
+ This is the official Nuxt layer for [Docus](https://docus.dev), providing a complete documentation theming. It works with the [Docus CLI](https://github.com/nuxt-content/docus/tree/main/cli) for rapid project setup.
11
11
 
12
12
  ## ๐Ÿš€ Features
13
13
 
@@ -108,8 +108,8 @@ Contributions are welcome! Please feel free to submit a Pull Request.
108
108
  ## ๐Ÿ“ž Support
109
109
 
110
110
  - ๐Ÿ“– [Documentation](https://docus.dev)
111
- - ๐Ÿ› [Issues](https://github.com/nuxtlabs/docus/issues)
112
- - ๐Ÿ’ฌ [Discussions](https://github.com/nuxtlabs/docus/discussions)
111
+ - ๐Ÿ› [Issues](https://github.com/nuxt-content/docus/issues)
112
+ - ๐Ÿ’ฌ [Discussions](https://github.com/nuxt-content/docus/discussions)
113
113
 
114
114
  ---
115
115
 
package/app/app.config.ts CHANGED
@@ -4,6 +4,12 @@ export default defineAppConfig({
4
4
  primary: 'emerald',
5
5
  neutral: 'zinc',
6
6
  },
7
+ commandPalette: {
8
+ slots: {
9
+ input: '[&_.iconify]:size-4 [&_.iconify]:mx-0.5',
10
+ itemLeadingIcon: 'size-4 mx-0.5',
11
+ },
12
+ },
7
13
  },
8
14
  uiPro: {
9
15
  contentNavigation: {
@@ -11,13 +17,6 @@ export default defineAppConfig({
11
17
  linkLeadingIcon: 'size-4 mr-1',
12
18
  linkTrailing: 'hidden',
13
19
  },
14
- variants: {
15
- active: {
16
- false: {
17
- link: 'text-toned hover:after:bg-accented',
18
- },
19
- },
20
- },
21
20
  defaultVariants: {
22
21
  variant: 'link',
23
22
  },
package/app/app.vue CHANGED
@@ -42,7 +42,7 @@ if (isEnabled.value) {
42
42
  })
43
43
  }
44
44
 
45
- const { data: navigation } = await useAsyncData(`navigation_${collectionName.value}`, () => queryCollectionNavigation(collectionName.value as keyof PageCollections), {
45
+ const { data: navigation } = await useAsyncData(() => `navigation_${collectionName.value}`, () => queryCollectionNavigation(collectionName.value as keyof PageCollections), {
46
46
  transform: (data) => {
47
47
  const rootResult = data.find(item => item.path === '/docs')?.children || data || []
48
48
 
@@ -58,13 +58,13 @@ function getEmojiFlag(locale: string): string {
58
58
  </UButton>
59
59
 
60
60
  <template #content>
61
- <ul class="flex flex-col gap-2">
61
+ <ul class="flex flex-col">
62
62
  <li
63
63
  v-for="localeItem in locales"
64
64
  :key="localeItem.code"
65
65
  >
66
66
  <NuxtLink
67
- class="flex justify-between py-2 px-1.5 gap-1 hover:bg-neutral-100 dark:hover:bg-neutral-800"
67
+ class="flex justify-between py-1.5 px-2 gap-1 hover:bg-muted"
68
68
  :to="switchLocalePath(localeItem.code) as string"
69
69
  :aria-label="localeItem.name"
70
70
  >
@@ -2,5 +2,9 @@
2
2
  <UContentSearchButton
3
3
  :collapsed="false"
4
4
  class="w-full"
5
+ variant="soft"
6
+ :ui="{
7
+ leadingIcon: 'size-4 mr-1',
8
+ }"
5
9
  />
6
10
  </template>
@@ -2,23 +2,17 @@
2
2
  import { useClipboard } from '@vueuse/core'
3
3
 
4
4
  const route = useRoute()
5
- const toast = useToast()
5
+
6
6
  const { copy, copied } = useClipboard()
7
7
  const { t } = useDocusI18n()
8
8
 
9
9
  const markdownLink = computed(() => `${window?.location?.origin}/raw${route.path}.md`)
10
10
  const items = [
11
11
  {
12
- label: 'Copy Markdown link',
12
+ label: t('docs.copy.link'),
13
13
  icon: 'i-lucide-link',
14
14
  onSelect() {
15
15
  copy(markdownLink.value)
16
-
17
- toast.add({
18
- title: t('docs.copy.link'),
19
- icon: 'i-lucide-check-circle',
20
- color: 'success',
21
- })
22
16
  },
23
17
  },
24
18
  {
@@ -51,11 +45,11 @@ async function copyPage() {
51
45
  <UButtonGroup size="sm">
52
46
  <UButton
53
47
  :label="t('docs.copy.page')"
54
- :icon="copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
48
+ :icon="copied ? 'i-lucide-check' : 'i-lucide-copy'"
55
49
  color="neutral"
56
- variant="outline"
50
+ variant="soft"
57
51
  :ui="{
58
- leadingIcon: [copied ? 'text-primary' : 'text-neutral', 'size-3.5'],
52
+ leadingIcon: 'text-neutral size-3.5',
59
53
  }"
60
54
  @click="copyPage"
61
55
  />
@@ -68,14 +62,12 @@ async function copyPage() {
68
62
  side: 'bottom',
69
63
  sideOffset: 8,
70
64
  }"
71
- :ui="{
72
- content: 'w-48',
73
- }"
74
65
  >
75
66
  <UButton
76
67
  icon="i-lucide-chevron-down"
77
68
  color="neutral"
78
- variant="outline"
69
+ variant="soft"
70
+ class="border-l border-muted"
79
71
  />
80
72
  </UDropdownMenu>
81
73
  </UButtonGroup>
@@ -45,7 +45,11 @@ useSeoMeta({
45
45
  ogDescription: description,
46
46
  })
47
47
 
48
- const headline = computed(() => findPageHeadline(navigation?.value, page.value?.path))
48
+ const headline = ref(findPageHeadline(navigation?.value, page.value?.path))
49
+ watch(() => navigation?.value, () => {
50
+ headline.value = findPageHeadline(navigation?.value, page.value?.path) || headline.value
51
+ })
52
+
49
53
  defineOgImageComponent('Docs', {
50
54
  headline: headline.value,
51
55
  })
@@ -12,8 +12,6 @@ if (!page.value) {
12
12
  throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
13
13
  }
14
14
 
15
- // Reconsider it once this is implemented: https://github.com/nuxt/content/issues/3419
16
- const prose = page.value.meta?.prose as boolean
17
15
  const title = page.value.seo?.title || page.value.title
18
16
  const description = page.value.seo?.description || page.value.description
19
17
 
@@ -42,6 +40,5 @@ else {
42
40
  <ContentRenderer
43
41
  v-if="page"
44
42
  :value="page"
45
- :prose="prose || false"
46
43
  />
47
44
  </template>
package/content.config.ts CHANGED
@@ -36,7 +36,7 @@ if (locales && Array.isArray(locales)) {
36
36
  type: 'page',
37
37
  source: {
38
38
  cwd,
39
- include: `${code}/**/*.md`,
39
+ include: `${code}/**/*`,
40
40
  prefix: `/${code}`,
41
41
  exclude: [`${code}/index.md`],
42
42
  },
@@ -0,0 +1,22 @@
1
+ {
2
+ "common": {
3
+ "or": "oder",
4
+ "error": {
5
+ "title": "Seite nicht gefunden",
6
+ "description": "Es tut uns leid, aber diese Seite konnte nicht gefunden werden."
7
+ }
8
+ },
9
+ "docs": {
10
+ "copy": {
11
+ "page": "Seite kopieren",
12
+ "link": "Markdown-Seite kopieren",
13
+ "view": "Als Markdown anzeigen",
14
+ "gpt": "In ChatGPT รถffnen",
15
+ "claude": "In Claude รถffnen"
16
+ },
17
+ "links": "Community",
18
+ "toc": "Auf dieser Seite",
19
+ "report": "Problem melden",
20
+ "edit": "Diese Seite bearbeiten"
21
+ }
22
+ }
@@ -9,7 +9,7 @@
9
9
  "docs": {
10
10
  "copy": {
11
11
  "page": "Copier la page",
12
- "link": "Copier la page Markdown",
12
+ "link": "Copier le lien Markdown",
13
13
  "view": "Voir en Markdown",
14
14
  "gpt": "Ouvrir dans ChatGPT",
15
15
  "claude": "Ouvrir dans Claude"
package/modules/config.ts CHANGED
@@ -49,10 +49,6 @@ export default defineNuxtModule({
49
49
  branch: getGitBranch(),
50
50
  })
51
51
 
52
- nuxt.options.appConfig.toc = defu(nuxt.options.appConfig.toc, {
53
- title: 'On this page',
54
- })
55
-
56
52
  /*
57
53
  ** I18N
58
54
  */
package/modules/css.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, addTemplate } from '@nuxt/kit'
1
+ import { defineNuxtModule, addTemplate, createResolver } from '@nuxt/kit'
2
2
  import { joinURL } from 'ufo'
3
3
  import { resolveModulePath } from 'exsolve'
4
4
 
@@ -8,10 +8,12 @@ export default defineNuxtModule({
8
8
  },
9
9
  async setup(_options, nuxt) {
10
10
  const dir = nuxt.options.rootDir
11
+ const resolver = createResolver(import.meta.url)
11
12
 
12
13
  const contentDir = joinURL(dir, 'content')
13
14
  const uiProPath = resolveModulePath('@nuxt/ui-pro', { from: import.meta.url, conditions: ['style'] })
14
15
  const tailwindPath = resolveModulePath('tailwindcss', { from: import.meta.url, conditions: ['style'] })
16
+ const layerDir = resolver.resolve('../app')
15
17
 
16
18
  const cssTemplate = addTemplate({
17
19
  filename: 'docus.css',
@@ -20,6 +22,7 @@ export default defineNuxtModule({
20
22
  @import ${JSON.stringify(uiProPath)};
21
23
 
22
24
  @source "${contentDir.replace(/\\/g, '/')}/**/*";
25
+ @source "${layerDir.replace(/\\/g, '/')}/**/*";
23
26
  @source "../../app.config.ts";`
24
27
  },
25
28
  })
package/nuxt.config.ts CHANGED
@@ -33,6 +33,13 @@ export default defineNuxtConfig({
33
33
  highlight: {
34
34
  langs: ['bash', 'diff', 'json', 'js', 'ts', 'html', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml'],
35
35
  },
36
+ remarkPlugins: {
37
+ 'remark-mdc': {
38
+ options: {
39
+ autoUnwrap: true,
40
+ },
41
+ },
42
+ },
36
43
  },
37
44
  },
38
45
  },
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "docus",
3
3
  "description": "Nuxt layer for Docus documentation theme",
4
- "version": "4.1.2",
4
+ "version": "4.1.4",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/nuxtlabs/docus.git"
9
+ "url": "git+https://github.com/nuxt-content/docus.git"
10
10
  },
11
11
  "private": false,
12
12
  "license": "MIT",