docus 3.0.0-beta.5 → 3.0.0-beta.6
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/package.json +1 -1
- package/theme/components/app/MobileNav.vue +2 -0
- package/theme/components/dev/Debug.vue +3 -0
- package/theme/components/globals/Icon.vue +1 -1
- package/theme/composables/useDocus.ts +1 -0
- package/theme/composables/useMenu.ts +1 -1
- package/theme/composables/useUserAgent.ts +2 -0
- package/theme/layouts/default.vue +2 -0
- package/theme/layouts/page.vue +2 -0
- package/theme/middleware/components.ts +2 -1
- package/theme/middleware/navigation.global.ts +1 -1
- package/theme/middleware/page.ts +1 -1
- package/theme/middleware/theme.global.ts +1 -1
- package/theme/pages/[...slug].vue +3 -1
- package/theme/plugins/menu.ts +2 -0
- package/theme/plugins/user-agent.ts +2 -0
- package/theme/utils/plugin.ts +1 -1
- package/theme/utils/queries.ts +3 -3
- package/theme/utils/theme.ts +2 -0
package/package.json
CHANGED
|
@@ -45,10 +45,13 @@ Object.entries({
|
|
|
45
45
|
reference,
|
|
46
46
|
() => {
|
|
47
47
|
if (key === 'page')
|
|
48
|
+
// eslint-disable-next-line no-console
|
|
48
49
|
console.log(`[${icons[key]}] Page updates detected! ${`(${(reference.value as ParsedContent)?.title})` || `(${(reference.value as ParsedContent)?.id})` || ''}`)
|
|
49
50
|
else
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
50
52
|
console.log(`[${icons[key]}] ${key[0].toUpperCase() + key.slice(1, key.length)} updates detected!`)
|
|
51
53
|
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
52
55
|
console.dir({ ...reference.value })
|
|
53
56
|
},
|
|
54
57
|
{
|
package/theme/layouts/page.vue
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { flattenComponents } from '../utils/components'
|
|
2
2
|
import { useDocusState } from '../utils/state'
|
|
3
3
|
import * as Components from '#components'
|
|
4
|
+
import { useNuxtApp } from '#imports'
|
|
4
5
|
|
|
5
6
|
export default defineNuxtRouteMiddleware(
|
|
6
|
-
async() => {
|
|
7
|
+
async () => {
|
|
7
8
|
const { page } = useDocusState()
|
|
8
9
|
const nuxtApp = useNuxtApp()
|
|
9
10
|
|
package/theme/middleware/page.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useDocus, useHead } from '#imports'
|
|
3
|
+
|
|
2
4
|
definePageMeta({
|
|
3
5
|
middleware: [
|
|
4
6
|
'page',
|
|
@@ -14,7 +16,7 @@ useHead({
|
|
|
14
16
|
meta: [
|
|
15
17
|
{ hid: 'og:site_name', property: 'og:site_name', content: 'Nuxt' },
|
|
16
18
|
{ hid: 'og:type', property: 'og:type', content: 'website' },
|
|
17
|
-
{ hid: 'twitter:site', name: 'twitter:site', content: theme.value?.url || theme.value?.twitter ||
|
|
19
|
+
{ hid: 'twitter:site', name: 'twitter:site', content: theme.value?.url || theme.value?.twitter || '' },
|
|
18
20
|
{
|
|
19
21
|
hid: 'twitter:card',
|
|
20
22
|
name: 'twitter:card',
|
package/theme/plugins/menu.ts
CHANGED
package/theme/utils/plugin.ts
CHANGED
package/theme/utils/queries.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { defaultThemeConfig } from './theme'
|
|
|
5
5
|
import { useDocusState } from './state'
|
|
6
6
|
import { fetchContentNavigation, queryContent } from '#imports'
|
|
7
7
|
|
|
8
|
-
export const queryPage = async(route: RouteLocationNormalized | RouteLocationNormalizedLoaded) => {
|
|
8
|
+
export const queryPage = async (route: RouteLocationNormalized | RouteLocationNormalizedLoaded) => {
|
|
9
9
|
const path = withoutTrailingSlash(route.path)
|
|
10
10
|
|
|
11
11
|
const { page, surround } = useDocusState()
|
|
@@ -39,7 +39,7 @@ export const queryPage = async(route: RouteLocationNormalized | RouteLocationNor
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export const queryNavigation = async() => {
|
|
42
|
+
export const queryNavigation = async () => {
|
|
43
43
|
const { navigation } = useDocusState()
|
|
44
44
|
|
|
45
45
|
navigation.value = await fetchContentNavigation(queryContent().where({
|
|
@@ -49,7 +49,7 @@ export const queryNavigation = async() => {
|
|
|
49
49
|
}))
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export const queryTheme = async() => {
|
|
52
|
+
export const queryTheme = async () => {
|
|
53
53
|
const { theme } = useDocusState()
|
|
54
54
|
|
|
55
55
|
// Fetch _theme.yml at `content/` root.
|
package/theme/utils/theme.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface ThemeDebugConfig {
|
|
|
12
12
|
|
|
13
13
|
export interface ThemeConfig {
|
|
14
14
|
title: string
|
|
15
|
+
url: string
|
|
15
16
|
description: string
|
|
16
17
|
twitter: string
|
|
17
18
|
github: string
|
|
@@ -33,6 +34,7 @@ export interface ThemeConfig {
|
|
|
33
34
|
|
|
34
35
|
export const defaultThemeConfig: ThemeConfig = {
|
|
35
36
|
title: 'Docus',
|
|
37
|
+
url: 'https://docus.dev',
|
|
36
38
|
twitter: '@docus_',
|
|
37
39
|
github: 'nuxtlabs/docus',
|
|
38
40
|
description: 'Write pages in markdown, use Vue components and enjoy the power of Nuxt with a blazing fast developer experience.',
|