@movk/nuxt-docs 1.2.1 → 1.3.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.
|
@@ -6,7 +6,7 @@ const route = useRoute()
|
|
|
6
6
|
|
|
7
7
|
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
8
8
|
|
|
9
|
-
const items = computed(() => mapContentNavigation(navigation?.value
|
|
9
|
+
const items = computed(() => mapContentNavigation(navigation?.value?.map(item => ({ ...item, children: undefined })) ?? [])?.map(item => ({
|
|
10
10
|
...item,
|
|
11
11
|
active: route.path.startsWith(item.to as string)
|
|
12
12
|
})))
|
package/content.config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
|
|
1
|
+
import { defineCollection, defineContentConfig, property, z } from '@nuxt/content'
|
|
2
2
|
import { useNuxt } from '@nuxt/kit'
|
|
3
3
|
import { asSeoCollection } from '@nuxtjs/seo/content'
|
|
4
4
|
import { joinURL } from 'ufo'
|
|
@@ -6,26 +6,6 @@ import { joinURL } from 'ufo'
|
|
|
6
6
|
const { options } = useNuxt()
|
|
7
7
|
const cwd = joinURL(options.rootDir, 'content')
|
|
8
8
|
|
|
9
|
-
const Avatar = z.object({
|
|
10
|
-
src: z.string(),
|
|
11
|
-
alt: z.string().optional()
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const Button = z.object({
|
|
15
|
-
label: z.string(),
|
|
16
|
-
icon: z.string().optional(),
|
|
17
|
-
avatar: Avatar.optional(),
|
|
18
|
-
leadingIcon: z.string().optional(),
|
|
19
|
-
trailingIcon: z.string().optional(),
|
|
20
|
-
to: z.string().optional(),
|
|
21
|
-
target: z.enum(['_blank', '_self']).optional(),
|
|
22
|
-
color: z.enum(['primary', 'neutral', 'success', 'warning', 'error', 'info']).optional(),
|
|
23
|
-
size: z.enum(['xs', 'sm', 'md', 'lg', 'xl']).optional(),
|
|
24
|
-
variant: z.enum(['solid', 'outline', 'subtle', 'soft', 'ghost', 'link']).optional(),
|
|
25
|
-
id: z.string().optional(),
|
|
26
|
-
class: z.string().optional()
|
|
27
|
-
})
|
|
28
|
-
|
|
29
9
|
export default defineContentConfig({
|
|
30
10
|
collections: {
|
|
31
11
|
landing: defineCollection(asSeoCollection({
|
|
@@ -42,27 +22,12 @@ export default defineContentConfig({
|
|
|
42
22
|
include: 'docs/**/*'
|
|
43
23
|
}],
|
|
44
24
|
schema: z.object({
|
|
45
|
-
links: z.
|
|
25
|
+
links: property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
|
|
46
26
|
category: z.string().optional(),
|
|
47
27
|
navigation: z.object({
|
|
48
28
|
title: z.string().optional()
|
|
49
29
|
})
|
|
50
30
|
})
|
|
51
|
-
})),
|
|
52
|
-
releases: defineCollection(asSeoCollection({
|
|
53
|
-
type: 'page',
|
|
54
|
-
source: {
|
|
55
|
-
cwd,
|
|
56
|
-
include: 'releases.yml'
|
|
57
|
-
},
|
|
58
|
-
schema: z.object({
|
|
59
|
-
hero: z.object({
|
|
60
|
-
title: z.string(),
|
|
61
|
-
description: z.string().optional(),
|
|
62
|
-
releases: z.string(),
|
|
63
|
-
links: z.array(Button).optional()
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
31
|
}))
|
|
67
32
|
}
|
|
68
33
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movk/nuxt-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "An elegant documentation theme for Nuxt, powered by Nuxt UI and Nuxt Content.",
|
|
7
7
|
"author": "YiXuan <mhaibaraai@gmail.com>",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"README.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@iconify-json/lucide": "^1.2.
|
|
31
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
30
|
+
"@iconify-json/lucide": "^1.2.73",
|
|
31
|
+
"@iconify-json/simple-icons": "^1.2.58",
|
|
32
32
|
"@iconify-json/vscode-icons": "^1.2.33",
|
|
33
33
|
"@movk/core": "^0.0.5",
|
|
34
34
|
"@nuxt/content": "^3.8.0",
|
|
35
|
-
"@nuxt/image": "^
|
|
36
|
-
"@nuxt/kit": "^4.2.
|
|
35
|
+
"@nuxt/image": "^2.0.0",
|
|
36
|
+
"@nuxt/kit": "^4.2.1",
|
|
37
37
|
"@nuxt/ui": "^4.1.0",
|
|
38
38
|
"@nuxtjs/seo": "^3.2.2",
|
|
39
39
|
"@vueuse/core": "^14.0.0",
|
|
40
40
|
"@vueuse/nuxt": "^14.0.0",
|
|
41
41
|
"defu": "^6.1.4",
|
|
42
|
-
"exsolve": "^1.0.
|
|
42
|
+
"exsolve": "^1.0.8",
|
|
43
43
|
"git-url-parse": "^16.1.0",
|
|
44
44
|
"motion-v": "^1.7.4",
|
|
45
45
|
"nuxt-component-meta": "^0.14.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"pkg-types": "^2.3.0",
|
|
50
50
|
"prettier": "^3.6.2",
|
|
51
51
|
"scule": "^1.3.0",
|
|
52
|
-
"tailwindcss": "^4.1.
|
|
52
|
+
"tailwindcss": "^4.1.17",
|
|
53
53
|
"ufo": "^1.6.1"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { kebabCase } from 'scule'
|
|
3
|
-
|
|
4
|
-
interface Star {
|
|
5
|
-
x: number
|
|
6
|
-
y: number
|
|
7
|
-
size: number
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { starCount = 300, color = 'var(--ui-primary)', size = { min: 1, max: 2 } } = defineProps<{
|
|
11
|
-
starCount?: number
|
|
12
|
-
color?: string
|
|
13
|
-
size?: { min: number, max: number }
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
const route = useRoute()
|
|
17
|
-
|
|
18
|
-
// Generate random star positions and sizes
|
|
19
|
-
function generateStars(count: number): Star[] {
|
|
20
|
-
return Array.from({ length: count }, () => ({
|
|
21
|
-
x: Math.floor(Math.random() * 2000),
|
|
22
|
-
y: Math.floor(Math.random() * 2000),
|
|
23
|
-
size: typeof size === 'number'
|
|
24
|
-
? size
|
|
25
|
-
: Math.random() * (size.max - size.min) + size.min
|
|
26
|
-
}))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Define speed configurations once
|
|
30
|
-
const speedMap = {
|
|
31
|
-
slow: { duration: 200, opacity: 0.5, ratio: 0.3 },
|
|
32
|
-
normal: { duration: 150, opacity: 0.75, ratio: 0.3 },
|
|
33
|
-
fast: { duration: 100, opacity: 1, ratio: 0.4 }
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Use a more efficient approach to generate and store stars
|
|
37
|
-
const stars = useState<{ slow: Star[], normal: Star[], fast: Star[] }>(`${kebabCase(route.path)}-stars`, () => {
|
|
38
|
-
return {
|
|
39
|
-
slow: generateStars(Math.floor(starCount * speedMap.slow.ratio)),
|
|
40
|
-
normal: generateStars(Math.floor(starCount * speedMap.normal.ratio)),
|
|
41
|
-
fast: generateStars(Math.floor(starCount * speedMap.fast.ratio))
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
// Compute star layers with different speeds and opacities
|
|
46
|
-
const starLayers = computed(() => [
|
|
47
|
-
{ stars: stars.value.fast, ...speedMap.fast },
|
|
48
|
-
{ stars: stars.value.normal, ...speedMap.normal },
|
|
49
|
-
{ stars: stars.value.slow, ...speedMap.slow }
|
|
50
|
-
])
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<template>
|
|
54
|
-
<div class="absolute pointer-events-none z-[-1] inset-y-0 inset-x-5 sm:inset-x-7 lg:inset-x-9 overflow-hidden">
|
|
55
|
-
<div class="stars size-full absolute inset-x-0 top-0">
|
|
56
|
-
<div
|
|
57
|
-
v-for="(layer, index) in starLayers"
|
|
58
|
-
:key="index"
|
|
59
|
-
class="star-layer"
|
|
60
|
-
:style="{
|
|
61
|
-
'--star-duration': `${layer.duration}s`,
|
|
62
|
-
'--star-opacity': layer.opacity,
|
|
63
|
-
'--star-color': color
|
|
64
|
-
}"
|
|
65
|
-
>
|
|
66
|
-
<div
|
|
67
|
-
v-for="(star, starIndex) in layer.stars"
|
|
68
|
-
:key="starIndex"
|
|
69
|
-
class="star absolute rounded-full"
|
|
70
|
-
:style="{
|
|
71
|
-
left: `${star.x}px`,
|
|
72
|
-
top: `${star.y}px`,
|
|
73
|
-
width: `${star.size}px`,
|
|
74
|
-
height: `${star.size}px`,
|
|
75
|
-
backgroundColor: 'var(--star-color)',
|
|
76
|
-
opacity: 'var(--star-opacity)'
|
|
77
|
-
}"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</template>
|
|
83
|
-
|
|
84
|
-
<style scoped>
|
|
85
|
-
.stars {
|
|
86
|
-
left: 50%;
|
|
87
|
-
transform: translate(-50%);
|
|
88
|
-
-webkit-mask-image: linear-gradient(
|
|
89
|
-
180deg,
|
|
90
|
-
rgba(217, 217, 217, 0) 0%,
|
|
91
|
-
rgba(217, 217, 217, 0.8) 25%,
|
|
92
|
-
#d9d9d9 50%,
|
|
93
|
-
rgba(217, 217, 217, 0.8) 75%,
|
|
94
|
-
rgba(217, 217, 217, 0) 100%
|
|
95
|
-
);
|
|
96
|
-
mask-image: linear-gradient(
|
|
97
|
-
180deg,
|
|
98
|
-
rgba(217, 217, 217, 0) 0%,
|
|
99
|
-
rgba(217, 217, 217, 0.8) 25%,
|
|
100
|
-
#d9d9d9 50%,
|
|
101
|
-
rgba(217, 217, 217, 0.8) 75%,
|
|
102
|
-
rgba(217, 217, 217, 0) 100%
|
|
103
|
-
);
|
|
104
|
-
-webkit-mask-size: cover;
|
|
105
|
-
mask-size: cover;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.star-layer {
|
|
109
|
-
animation: risingStarsAnimation linear infinite;
|
|
110
|
-
animation-duration: var(--star-duration);
|
|
111
|
-
will-change: transform;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@keyframes risingStarsAnimation {
|
|
115
|
-
0% {
|
|
116
|
-
transform: translateY(0);
|
|
117
|
-
}
|
|
118
|
-
100% {
|
|
119
|
-
transform: translateY(-2000px);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
</style>
|
package/app/pages/releases.vue
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const { data: page } = await useAsyncData('releases', () => queryCollection('releases').first())
|
|
3
|
-
if (!page.value) {
|
|
4
|
-
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const title = page.value.seo?.title || page.value.title
|
|
8
|
-
const description = page.value.seo?.description || page.value.description
|
|
9
|
-
|
|
10
|
-
useSeoMeta({
|
|
11
|
-
title,
|
|
12
|
-
description,
|
|
13
|
-
ogTitle: title,
|
|
14
|
-
ogDescription: description
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
defineOgImageComponent('Nuxt', {
|
|
18
|
-
title,
|
|
19
|
-
description
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const { data: versions } = await useFetch(page.value.hero.releases || '', {
|
|
23
|
-
transform: (data: {
|
|
24
|
-
releases: {
|
|
25
|
-
name?: string
|
|
26
|
-
tag: string
|
|
27
|
-
publishedAt: string
|
|
28
|
-
markdown: string
|
|
29
|
-
}[]
|
|
30
|
-
}) => {
|
|
31
|
-
return data.releases.map(release => ({
|
|
32
|
-
tag: release.tag,
|
|
33
|
-
title: release.name || release.tag,
|
|
34
|
-
date: release.publishedAt,
|
|
35
|
-
markdown: release.markdown
|
|
36
|
-
}))
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<template>
|
|
42
|
-
<div v-if="page">
|
|
43
|
-
<UPageHero
|
|
44
|
-
:title="page.hero.title"
|
|
45
|
-
:description="page.hero.description"
|
|
46
|
-
:links="page.hero.links"
|
|
47
|
-
class="md:border-b border-default"
|
|
48
|
-
:ui="{
|
|
49
|
-
container: 'relative lg:py-32'
|
|
50
|
-
}"
|
|
51
|
-
>
|
|
52
|
-
<template #top>
|
|
53
|
-
<div
|
|
54
|
-
class="absolute z-[-1] rounded-full bg-primary blur-[300px] size-60 sm:size-80 transform -translate-x-1/2 left-1/2 -translate-y-80"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<LazyStarsBg />
|
|
59
|
-
|
|
60
|
-
<div
|
|
61
|
-
aria-hidden="true"
|
|
62
|
-
class="hidden md:block absolute z-[-1] border-x border-default inset-0 mx-4 sm:mx-6 lg:mx-8"
|
|
63
|
-
/>
|
|
64
|
-
</UPageHero>
|
|
65
|
-
|
|
66
|
-
<UPageSection :ui="{ container: 'py-0!' }">
|
|
67
|
-
<div class="py-4 md:py-8 lg:py-16 md:border-x border-default">
|
|
68
|
-
<UContainer class="max-w-5xl">
|
|
69
|
-
<UChangelogVersions>
|
|
70
|
-
<UChangelogVersion
|
|
71
|
-
v-for="version in versions"
|
|
72
|
-
:key="version.tag"
|
|
73
|
-
v-bind="version"
|
|
74
|
-
:ui="{
|
|
75
|
-
root: 'flex items-start',
|
|
76
|
-
container: 'max-w-xl',
|
|
77
|
-
header: 'border-b border-default pb-4',
|
|
78
|
-
title: 'text-3xl',
|
|
79
|
-
date: 'text-xs/9 text-highlighted font-mono',
|
|
80
|
-
indicator: 'sticky top-0 pt-16 -mt-16 sm:pt-24 sm:-mt-24 lg:pt-32 lg:-mt-32'
|
|
81
|
-
}"
|
|
82
|
-
>
|
|
83
|
-
<template #body>
|
|
84
|
-
<MDC v-if="version.markdown" :value="version.markdown" />
|
|
85
|
-
</template>
|
|
86
|
-
</UChangelogVersion>
|
|
87
|
-
</UChangelogVersions>
|
|
88
|
-
</UContainer>
|
|
89
|
-
</div>
|
|
90
|
-
</UPageSection>
|
|
91
|
-
</div>
|
|
92
|
-
</template>
|