docus 5.0.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.
@@ -8,7 +8,7 @@ const links = computed(() => [
8
8
  'target': '_blank',
9
9
  'aria-label': `${key} social link`,
10
10
  })),
11
- appConfig.github?.url && {
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?.url
9
+ const links = computed(() => appConfig.github && appConfig.github.url
10
10
  ? [
11
11
  {
12
12
  'icon': 'i-simple-icons-github',
@@ -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.flatMap(item => item.children || [item]) || [])
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 (!appConfig.github) {
52
+ if (!github.value) {
51
53
  return
52
54
  }
53
55
 
54
56
  return [
55
- appConfig.github.url,
57
+ github.value.url,
56
58
  'edit',
57
- appConfig.github.branch,
58
- appConfig.github.rootDir,
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="editLink"
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="`${appConfig.github.url}/issues/new/choose`"
114
+ :to="`${github.url}/issues/new/choose`"
113
115
  target="_blank"
114
116
  icon="i-lucide-alert-circle"
115
117
  :ui="{ leadingIcon: 'size-4' }"
@@ -32,7 +32,7 @@ declare module 'nuxt/schema' {
32
32
  url: string
33
33
  branch: string
34
34
  rootDir?: string
35
- }
35
+ } | false
36
36
  }
37
37
  }
38
38
 
@@ -0,0 +1,7 @@
1
+ import type { ContentNavigationItem } from '@nuxt/content'
2
+
3
+ export const flattenNavigation = (items?: ContentNavigationItem[]): ContentNavigationItem[] => items?.flatMap(
4
+ item => item.children
5
+ ? flattenNavigation(item.children)
6
+ : [item],
7
+ ) || []
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": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
7
7
  "repository": {
@@ -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.1",
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",