docus 3.0.6-20250701-083836-42ab7dc → 3.1.0-20250619-105902-65a477a

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
@@ -15,7 +15,6 @@ Ship fast, flexible, and SEO-optimized documentation with beautiful design out o
15
15
  - [Nuxt UI](https://ui.nuxt.com/)
16
16
  - [Nuxt Image](https://image.nuxt.com/)
17
17
  - [Nuxt LLMs](https://github.com/nuxtlabs/nuxt-llms)
18
- - [Nuxt SEO](https://nuxtseo.com/)
19
18
  - [UnJS ecosystem](https://unjs.io/)
20
19
  - [Nuxt Studio](https://content.nuxt.com/studio)
21
20
 
@@ -19,9 +19,6 @@ export default defineAppConfig({
19
19
  },
20
20
  },
21
21
  },
22
- defaultVariants: {
23
- variant: 'link',
24
- },
25
22
  },
26
23
  pageLinks: {
27
24
  slots: {
@@ -1,7 +1,3 @@
1
- <script setup lang="ts">
2
- const appConfig = useAppConfig()
3
- </script>
4
-
5
1
  <template>
6
2
  <div
7
3
  v-if="appConfig.toc?.bottom?.links?.length"
@@ -15,3 +11,7 @@ const appConfig = useAppConfig()
15
11
  />
16
12
  </div>
17
13
  </template>
14
+
15
+ <script setup lang="ts">
16
+ const appConfig = useAppConfig()
17
+ </script>
@@ -1,60 +1,17 @@
1
- <script setup lang="ts">
2
- import { useClipboard } from '@vueuse/core'
3
-
4
- const route = useRoute()
5
- const toast = useToast()
6
- const { copy, copied } = useClipboard()
7
-
8
- const markdownLink = computed(() => `${window?.location?.origin}/raw${route.path}.md`)
9
-
10
- const items = [
11
- {
12
- label: 'Copy Markdown link',
13
- icon: 'i-lucide-link',
14
- onSelect() {
15
- copy(markdownLink.value)
16
-
17
- toast.add({
18
- title: 'Markdown link copied to clipboard',
19
- icon: 'i-lucide-check-circle',
20
- color: 'success',
21
- })
22
- },
23
- },
24
- {
25
- label: 'View as Markdown',
26
- icon: 'i-simple-icons:markdown',
27
- target: '_blank',
28
- to: markdownLink.value,
29
- },
30
- {
31
- label: 'Open in ChatGPT',
32
- icon: 'i-simple-icons:openai',
33
- target: '_blank',
34
- to: `https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${markdownLink.value} so I can ask questions about it.`)}`,
35
- },
36
- {
37
- label: 'Open in Claude',
38
- icon: 'i-simple-icons:anthropic',
39
- target: '_blank',
40
- to: `https://claude.ai/new?q=${encodeURIComponent(`Read ${markdownLink.value} so I can ask questions about it.`)}`,
41
- },
42
- ]
43
- </script>
44
-
45
1
  <template>
46
- <UButtonGroup size="sm">
2
+ <UButtonGroup>
47
3
  <UButton
48
4
  label="Copy page"
49
- :icon="copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
5
+ :icon="copyStatus === 'copied' ? 'i-lucide-copy-check' : 'i-lucide-copy'"
50
6
  color="neutral"
51
7
  variant="outline"
8
+ :loading="copyStatus === 'copying'"
9
+ size="xs"
52
10
  :ui="{
53
- leadingIcon: [copied ? 'text-primary' : 'text-neutral', 'size-3.5'],
11
+ leadingIcon: [copyStatus === 'copied' ? 'text-primary' : 'text-neutral', 'size-3.5'],
54
12
  }"
55
- @click="copy(markdownLink)"
13
+ @click="copyPage"
56
14
  />
57
-
58
15
  <UDropdownMenu
59
16
  size="sm"
60
17
  :items="items"
@@ -69,9 +26,66 @@ const items = [
69
26
  >
70
27
  <UButton
71
28
  icon="i-lucide-chevron-down"
29
+ size="sm"
72
30
  color="neutral"
73
31
  variant="outline"
74
32
  />
75
33
  </UDropdownMenu>
76
34
  </UButtonGroup>
77
35
  </template>
36
+
37
+ <script setup lang="ts">
38
+ const route = useRoute()
39
+ const copyStatus = ref<'idle' | 'copying' | 'copied'>('idle')
40
+
41
+ const items = [
42
+ {
43
+ label: 'Copy Markdown link',
44
+ icon: 'i-lucide-link',
45
+ onSelect() {
46
+ navigator.clipboard.writeText(`${window.location.origin}/raw${route.path}.md`)
47
+ },
48
+ },
49
+ {
50
+ label: 'View as Markdown',
51
+ icon: 'i-simple-icons:markdown',
52
+ target: '_blank',
53
+ onSelect() {
54
+ window.open(`${window.location.origin}/raw${route.path}.md`, '_blank')
55
+ },
56
+ },
57
+ {
58
+ label: 'Open in ChatGPT',
59
+ icon: 'i-simple-icons:openai',
60
+ target: '_blank',
61
+ onSelect() {
62
+ window.open(`https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${window.location.origin}/raw${route.path}.md so I can ask questions about it.`)}`, '_blank')
63
+ },
64
+ },
65
+ {
66
+ label: 'Open in Claude',
67
+ icon: 'i-simple-icons:anthropic',
68
+ target: '_blank',
69
+ onSelect() {
70
+ window.open(`https://claude.ai/new?q=${encodeURIComponent(`Read ${window.location.origin}/raw${route.path}.md so I can ask questions about it.`)}`, '_blank')
71
+ },
72
+ },
73
+ ]
74
+
75
+ async function copyPage() {
76
+ copyStatus.value = 'copying'
77
+ const markdown = await $fetch<string>(`${window.location.origin}/raw${route.path}.md`)
78
+ copyToClipboard(markdown)
79
+ copyStatus.value = 'copied'
80
+ setTimeout(() => {
81
+ copyStatus.value = 'idle'
82
+ }, 2000)
83
+ }
84
+
85
+ function copyToClipboard(text: string) {
86
+ // Fix for iOS Safari: https://stackoverflow.com/questions/62327358/javascript-clipboard-api-safari-ios-notallowederror-message
87
+ setTimeout(async () => {
88
+ await navigator.clipboard.writeText(text)
89
+ }, 0)
90
+ }
91
+ </script>
@@ -13,6 +13,7 @@ const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
13
13
 
14
14
  <UContentNavigation
15
15
  highlight
16
+ variant="link"
16
17
  :navigation="navigation"
17
18
  />
18
19
  </UPageAside>
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { kebabCase } from 'scule'
3
2
  import type { ContentNavigationItem } from '@nuxt/content'
4
- import { findPageHeadline } from '@nuxt/content/utils'
5
- import { addPrerenderPath } from '../utils/prerender'
3
+ import { kebabCase } from 'scule'
4
+ import { findPageHeadline } from '#ui-pro/utils/content'
6
5
 
7
6
  definePageMeta({
8
7
  layout: 'docs',
@@ -25,9 +24,6 @@ if (!page.value) {
25
24
  throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
26
25
  }
27
26
 
28
- // Add the page path to the prerender list
29
- addPrerenderPath(`/raw${route.path}.md`)
30
-
31
27
  const title = page.value.seo?.title || page.value.title
32
28
  const description = page.value.seo?.description || page.value.description
33
29
 
@@ -38,24 +34,13 @@ useSeoMeta({
38
34
  ogDescription: description,
39
35
  })
40
36
 
41
- const headline = computed(() => findPageHeadline(navigation?.value, page.value?.path))
37
+ const headline = computed(() => findPageHeadline(navigation?.value, page.value))
42
38
  defineOgImageComponent('Docs', {
43
39
  headline: headline.value,
44
40
  })
45
41
 
46
42
  const editLink = computed(() => {
47
- if (!appConfig.github) {
48
- return
49
- }
50
-
51
- return [
52
- appConfig.github.url,
53
- 'edit',
54
- appConfig.github.branch,
55
- appConfig.github.rootDir,
56
- 'content',
57
- `${page.value?.stem}.${page.value?.extension}`,
58
- ].filter(Boolean).join('/')
43
+ return appConfig.github && `${appConfig.github.url}/edit/${appConfig.github.branch}/content/${page.value?.stem}.${page.value?.extension}`
59
44
  })
60
45
  </script>
61
46
 
@@ -64,19 +49,13 @@ const editLink = computed(() => {
64
49
  <UPageHeader
65
50
  :title="page.title"
66
51
  :description="page.description"
52
+ :links="page.links"
67
53
  :headline="headline"
68
54
  :ui="{
69
55
  wrapper: 'flex-row items-center flex-wrap justify-between',
70
56
  }"
71
57
  >
72
58
  <template #links>
73
- <UButton
74
- v-for="(link, index) in page.links"
75
- :key="index"
76
- size="sm"
77
- v-bind="link"
78
- />
79
-
80
59
  <DocsPageHeaderLinks />
81
60
  </template>
82
61
  </UPageHeader>
@@ -123,7 +102,6 @@ const editLink = computed(() => {
123
102
  #right
124
103
  >
125
104
  <UContentToc
126
- highlight
127
105
  :title="appConfig.toc?.title || 'Table of Contents'"
128
106
  :links="page.body?.toc?.links"
129
107
  >
@@ -4,8 +4,6 @@ if (!page.value) {
4
4
  throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
5
5
  }
6
6
 
7
- // Reconsider it once this is implemented: https://github.com/nuxt/content/issues/3419
8
- const prose = page.value.meta.prose
9
7
  const title = page.value.seo?.title || page.value.title
10
8
  const description = page.value.seo?.description || page.value.description
11
9
 
@@ -34,6 +32,6 @@ else {
34
32
  <ContentRenderer
35
33
  v-if="page"
36
34
  :value="page"
37
- :prose="prose || false"
35
+ :prose="false"
38
36
  />
39
37
  </template>
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule } from '@nuxt/kit'
1
+ import { defineNuxtModule } from 'nuxt/kit'
2
2
  import { defu } from 'defu'
3
3
  import { inferSiteURL, getPackageJsonMetadata } from '../app/utils/meta'
4
4
  import { getGitBranch, getGitEnv, getLocalGitInfo } from '../app/utils/git'
@@ -26,15 +26,6 @@ export default defineNuxtConfig({
26
26
  enabled: dev,
27
27
  },
28
28
  css: ['../app/assets/css/main.css'],
29
- content: {
30
- build: {
31
- markdown: {
32
- highlight: {
33
- langs: ['bash', 'diff', 'json', 'js', 'ts', 'html', 'css', 'vue', 'shell', 'mdc', 'md', 'yaml'],
34
- },
35
- },
36
- },
37
- },
38
29
  future: {
39
30
  compatibilityVersion: 4,
40
31
  },
@@ -43,7 +34,6 @@ export default defineNuxtConfig({
43
34
  routes: ['/'],
44
35
  crawlLinks: true,
45
36
  failOnError: false,
46
- autoSubfolderIndex: false,
47
37
  },
48
38
  },
49
39
  icon: {
@@ -189,27 +189,13 @@ export default defineNuxtSchema({
189
189
  github: group({
190
190
  title: 'GitHub',
191
191
  description: 'GitHub configuration.',
192
- icon: 'i-simple-icons-github',
192
+ icon: 'i-lucide-github',
193
193
  fields: {
194
194
  url: field({
195
195
  type: 'string',
196
196
  title: 'URL',
197
197
  description: 'GitHub URL.',
198
- icon: 'i-simple-icons-github',
199
- default: '',
200
- }),
201
- branch: field({
202
- type: 'string',
203
- title: 'Branch',
204
- description: 'GitHub branch.',
205
- icon: 'i-lucide-git-branch',
206
- default: 'main',
207
- }),
208
- rootDir: field({
209
- type: 'string',
210
- title: 'Root Directory',
211
- description: 'Root directory of the GitHub repository.',
212
- icon: 'i-lucide-folder',
198
+ icon: 'i-lucide-github',
213
199
  default: '',
214
200
  }),
215
201
  },
@@ -224,6 +210,20 @@ declare module '@nuxt/schema' {
224
210
  title: string
225
211
  description: string
226
212
  }
213
+ ui: {
214
+ colors: {
215
+ primary: string
216
+ neutral: string
217
+ }
218
+ icons: {
219
+ search: string
220
+ dark: string
221
+ light: string
222
+ external: string
223
+ chevron: string
224
+ hash: string
225
+ } & Record<string, string>
226
+ }
227
227
  header: {
228
228
  title: string
229
229
  logo: {
@@ -250,7 +250,6 @@ declare module '@nuxt/schema' {
250
250
  name: string
251
251
  url: string
252
252
  branch: string
253
- rootDir?: string
254
253
  }
255
254
  }
256
255
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/nuxtlabs/docus"
7
7
  },
8
8
  "private": false,
9
- "version": "3.0.6-20250701-083836-42ab7dc",
9
+ "version": "3.1.0-20250619-105902-65a477a",
10
10
  "keywords": [],
11
11
  "license": "MIT",
12
12
  "bin": {
@@ -31,28 +31,27 @@
31
31
  "release": "npm run lint && npm run test && npm run build && release-it"
32
32
  },
33
33
  "dependencies": {
34
- "@iconify-json/lucide": "^1.2.54",
35
- "@iconify-json/simple-icons": "^1.2.41",
36
- "@iconify-json/vscode-icons": "^1.2.23",
37
- "@nuxt/content": "^3.6.1",
34
+ "@iconify-json/lucide": "^1.2.47",
35
+ "@iconify-json/simple-icons": "^1.2.38",
36
+ "@iconify-json/vscode-icons": "^1.2.22",
37
+ "@nuxt/content": "^3.6.0",
38
38
  "@nuxt/image": "^1.10.0",
39
39
  "@nuxt/kit": "^3.17.5",
40
- "@nuxt/ui-pro": "^3.2.0",
40
+ "@nuxt/ui-pro": "^3.1.3",
41
41
  "@nuxtjs/mdc": "^0.17.0",
42
- "@nuxtjs/robots": "^5.3.0",
42
+ "@nuxtjs/robots": "^5.2.10",
43
43
  "c12": "^3.0.4",
44
44
  "citty": "^0.1.6",
45
- "defu": "^6.1.4",
46
- "dotenv": "^17.0.0",
45
+ "dotenv": "^16.5.0",
47
46
  "git-url-parse": "^16.1.0",
48
47
  "minimark": "^0.2.0",
49
- "motion-v": "^1.3.1",
48
+ "motion-v": "^1.2.1",
50
49
  "nuxi": "^3.25.1",
51
50
  "nuxt-llms": "^0.1.3",
52
- "nuxt-og-image": "^5.1.8",
53
- "pkg-types": "^2.2.0",
51
+ "nuxt-og-image": "^5.1.6",
52
+ "pkg-types": "^2.1.0",
54
53
  "scule": "^1.3.0",
55
- "tailwindcss": "^4.1.11",
54
+ "tailwindcss": "^4.1.8",
56
55
  "ufo": "^1.6.1",
57
56
  "unctx": "^2.4.1",
58
57
  "unist-util-visit": "^5.0.0"
@@ -61,18 +60,18 @@
61
60
  "@nuxt/eslint-config": "^1.4.1",
62
61
  "@release-it/conventional-changelog": "^10.0.1",
63
62
  "@stylistic/eslint-plugin": "^4.4.1",
64
- "@types/node": "^24.0.8",
65
- "@typescript-eslint/parser": "^8.35.1",
63
+ "@types/node": "^24.0.0",
64
+ "@typescript-eslint/parser": "^8.34.0",
66
65
  "changelogen": "^0.6.1",
67
- "eslint": "^9.30.0",
66
+ "eslint": "^9.28.0",
68
67
  "release-it": "^19.0.3",
69
68
  "tsup": "^8.5.0",
70
- "tsx": "^4.20.3",
69
+ "tsx": "^4.19.4",
71
70
  "typescript": "^5.8.3"
72
71
  },
73
72
  "peerDependencies": {
74
73
  "better-sqlite3": "11.x",
75
74
  "nuxt": "3.x"
76
75
  },
77
- "packageManager": "pnpm@10.12.4"
76
+ "packageManager": "pnpm@10.12.1"
78
77
  }
@@ -1,12 +0,0 @@
1
- export const addPrerenderPath = (path: string) => {
2
- const event = useRequestEvent()
3
- if (event) {
4
- event.node.res.setHeader(
5
- 'x-nitro-prerender',
6
- [
7
- event.node.res.getHeader('x-nitro-prerender'),
8
- path,
9
- ].filter(Boolean).join(','),
10
- )
11
- }
12
- }