undocs 0.4.7 → 0.4.9
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/app/assets/main.css +0 -5
- package/app/components/page/PageContributors.vue +27 -0
- package/app/components/page/PageSponsors.vue +61 -0
- package/app/composables/useContributors.ts +1 -1
- package/app/composables/useDocsNav.ts +1 -1
- package/app/modules/css.ts +32 -0
- package/app/pages/[...slug].vue +1 -1
- package/app/pages/index.vue +2 -79
- package/package.json +1 -1
package/app/assets/main.css
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const docsConfig = useAppConfig().docs
|
|
3
|
+
const { data: contributors } = await useAsyncData(() => useContributors())
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<UPageSection v-if="contributors?.length" id="contributors" title="Contributors">
|
|
8
|
+
<div class="flex flex-wrap justify-center gap-2">
|
|
9
|
+
<UTooltip v-for="c in contributors" :key="c.username" :text="c.name" :delay-duration="0">
|
|
10
|
+
<a :href="c.profile" target="_blank" class="opacity-80 hover:opacity-100">
|
|
11
|
+
<UAvatar :alt="c.name" :src="c.avatar" size="3xl" />
|
|
12
|
+
</a>
|
|
13
|
+
</UTooltip>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="text-center">
|
|
16
|
+
<UButton
|
|
17
|
+
v-if="docsConfig.github"
|
|
18
|
+
:to="`https://github.com/${docsConfig.github}`"
|
|
19
|
+
target="_blank"
|
|
20
|
+
color="neutral"
|
|
21
|
+
icon="i-lucide-git-pull-request"
|
|
22
|
+
>
|
|
23
|
+
Contribute on GitHub
|
|
24
|
+
</UButton>
|
|
25
|
+
</div>
|
|
26
|
+
</UPageSection>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { data: sponsors } = await useAsyncData(() => useSponsors())
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<UPageSection v-if="sponsors?.sponsors.length" title="Sponsors" class="bg-muted/30 border-y border-default">
|
|
7
|
+
<div id="sponsors" class="flex flex-col items-center gap-8">
|
|
8
|
+
<div
|
|
9
|
+
v-for="(tier, i) of sponsors.sponsors.slice(0, 2)"
|
|
10
|
+
:key="i"
|
|
11
|
+
class="flex flex-wrap justify-center gap-8 max-w-4xl"
|
|
12
|
+
>
|
|
13
|
+
<div v-for="s in tier" :key="s.name" class="flex items-center gap-6 max-w-[300px]">
|
|
14
|
+
<a
|
|
15
|
+
:href="s.website"
|
|
16
|
+
target="_blank"
|
|
17
|
+
class="flex items-center gap-2 opacity-80 hover:opacity-100"
|
|
18
|
+
:class="`font-size-${i === 0 ? '3xl' : i === 1 ? 'xl' : 'lg'}`"
|
|
19
|
+
>
|
|
20
|
+
<img
|
|
21
|
+
v-if="s.image"
|
|
22
|
+
:src="s.image"
|
|
23
|
+
:alt="s.name"
|
|
24
|
+
class="object-contain rounded-lg"
|
|
25
|
+
:style="{
|
|
26
|
+
width: i === 0 ? '80px' : '48px',
|
|
27
|
+
height: i === 0 ? '80px' : '48px',
|
|
28
|
+
}"
|
|
29
|
+
/>
|
|
30
|
+
<span v-if="i < 2" class="font-semibold" :class="`text-${i === 0 ? '2xl' : 'xl'}`">{{ s.name }}</span>
|
|
31
|
+
</a>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="flex flex-wrap justify-center gap-2">
|
|
35
|
+
<UTooltip v-for="s in sponsors.sponsors[2]" :key="s.name" :text="s.name" :delay-duration="0">
|
|
36
|
+
<a :href="s.website" target="_blank" class="opacity-80 hover:opacity-100">
|
|
37
|
+
<UAvatar :alt="s.name" :src="s.image" size="2xl" />
|
|
38
|
+
</a>
|
|
39
|
+
</UTooltip>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="flex flex-wrap justify-center gap-1">
|
|
42
|
+
<UTooltip v-for="s in sponsors.sponsors[3]" :key="s.name" :text="s.name" :delay-duration="0">
|
|
43
|
+
<a :href="s.website" target="_blank" class="opacity-80 hover:opacity-100">
|
|
44
|
+
<UAvatar :alt="s.name" :src="s.image" />
|
|
45
|
+
</a>
|
|
46
|
+
</UTooltip>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="text-center">
|
|
50
|
+
<UButton
|
|
51
|
+
v-if="sponsors.username"
|
|
52
|
+
icon="i-lucide-heart-handshake"
|
|
53
|
+
:to="`https://github.com/sponsors/${sponsors.username}`"
|
|
54
|
+
target="_blank"
|
|
55
|
+
color="neutral"
|
|
56
|
+
>
|
|
57
|
+
Become a Sponsor
|
|
58
|
+
</UButton>
|
|
59
|
+
</div>
|
|
60
|
+
</UPageSection>
|
|
61
|
+
</template>
|
|
@@ -7,7 +7,7 @@ export interface Contributor {
|
|
|
7
7
|
|
|
8
8
|
export async function useContributors(): Promise<Contributor[] | undefined> {
|
|
9
9
|
const { docs: docsConfig } = useAppConfig()
|
|
10
|
-
if (!docsConfig.github
|
|
10
|
+
if (!docsConfig.github) {
|
|
11
11
|
return
|
|
12
12
|
}
|
|
13
13
|
const { contributors = [] } = await await $fetch<{ contributors: { username: string }[] }>(
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineNuxtModule, addTemplate, createResolver } from '@nuxt/kit'
|
|
2
|
+
import { joinURL } from 'ufo'
|
|
3
|
+
import { resolveModulePath } from 'exsolve'
|
|
4
|
+
|
|
5
|
+
export default defineNuxtModule({
|
|
6
|
+
meta: {
|
|
7
|
+
name: 'css',
|
|
8
|
+
},
|
|
9
|
+
async setup(_options, nuxt) {
|
|
10
|
+
const dir = nuxt.options.rootDir
|
|
11
|
+
const resolver = createResolver(import.meta.url)
|
|
12
|
+
|
|
13
|
+
const contentDir = joinURL(dir, '../')
|
|
14
|
+
const uiPath = resolveModulePath('@nuxt/ui', { from: import.meta.url, conditions: ['style'] })
|
|
15
|
+
const tailwindPath = resolveModulePath('tailwindcss', { from: import.meta.url, conditions: ['style'] })
|
|
16
|
+
const layerDir = resolver.resolve('../')
|
|
17
|
+
|
|
18
|
+
const cssTemplate = addTemplate({
|
|
19
|
+
filename: 'undocs.css',
|
|
20
|
+
getContents: () => {
|
|
21
|
+
return `@import ${JSON.stringify(tailwindPath)};
|
|
22
|
+
@import ${JSON.stringify(uiPath)};
|
|
23
|
+
|
|
24
|
+
@source "${contentDir.replace(/\\/g, '/')}/**/*.md";
|
|
25
|
+
@source "${layerDir.replace(/\\/g, '/')}/**/*";
|
|
26
|
+
@source "../../app.config.ts";`
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
nuxt.options.css.unshift(cssTemplate.dst)
|
|
31
|
+
},
|
|
32
|
+
})
|
package/app/pages/[...slug].vue
CHANGED
package/app/pages/index.vue
CHANGED
|
@@ -96,9 +96,6 @@ const { data: latest } = await useAsyncData(() =>
|
|
|
96
96
|
.first()
|
|
97
97
|
.then((res) => res),
|
|
98
98
|
)
|
|
99
|
-
|
|
100
|
-
const { data: sponsors } = await useAsyncData(() => useSponsors())
|
|
101
|
-
const { data: contributors } = await useAsyncData(() => useContributors())
|
|
102
99
|
</script>
|
|
103
100
|
|
|
104
101
|
<template>
|
|
@@ -177,81 +174,7 @@ const { data: contributors } = await useAsyncData(() => useContributors())
|
|
|
177
174
|
</template>
|
|
178
175
|
</UPageSection>
|
|
179
176
|
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
<div
|
|
183
|
-
v-for="(tier, i) of sponsors.sponsors.slice(0, 2)"
|
|
184
|
-
:key="i"
|
|
185
|
-
class="flex flex-wrap justify-center gap-8 max-w-4xl"
|
|
186
|
-
>
|
|
187
|
-
<div v-for="s in tier" :key="s.name" class="flex items-center gap-6 max-w-[300px]">
|
|
188
|
-
<a
|
|
189
|
-
:href="s.website"
|
|
190
|
-
target="_blank"
|
|
191
|
-
class="flex items-center gap-2 opacity-80 hover:opacity-100"
|
|
192
|
-
:class="`font-size-${i === 0 ? '3xl' : i === 1 ? 'xl' : 'lg'}`"
|
|
193
|
-
>
|
|
194
|
-
<img
|
|
195
|
-
v-if="s.image"
|
|
196
|
-
:src="s.image"
|
|
197
|
-
:alt="s.name"
|
|
198
|
-
class="object-contain rounded-lg"
|
|
199
|
-
:style="{
|
|
200
|
-
width: i === 0 ? '80px' : '48px',
|
|
201
|
-
height: i === 0 ? '80px' : '48px',
|
|
202
|
-
}"
|
|
203
|
-
/>
|
|
204
|
-
<span v-if="i < 2" class="font-semibold" :class="`text-${i === 0 ? '2xl' : 'xl'}`">{{ s.name }}</span>
|
|
205
|
-
</a>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
<div class="flex flex-wrap justify-center gap-2">
|
|
209
|
-
<UTooltip v-for="s in sponsors.sponsors[2]" :key="s.name" :text="s.name" :delay-duration="0">
|
|
210
|
-
<a :href="s.website" target="_blank" class="opacity-80 hover:opacity-100">
|
|
211
|
-
<UAvatar :alt="s.name" :src="s.image" size="2xl" />
|
|
212
|
-
</a>
|
|
213
|
-
</UTooltip>
|
|
214
|
-
</div>
|
|
215
|
-
<div class="flex flex-wrap justify-center gap-1">
|
|
216
|
-
<UTooltip v-for="s in sponsors.sponsors[3]" :key="s.name" :text="s.name" :delay-duration="0">
|
|
217
|
-
<a :href="s.website" target="_blank" class="opacity-80 hover:opacity-100">
|
|
218
|
-
<UAvatar :alt="s.name" :src="s.image" />
|
|
219
|
-
</a>
|
|
220
|
-
</UTooltip>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
<div class="text-center">
|
|
224
|
-
<UButton
|
|
225
|
-
v-if="sponsors.username"
|
|
226
|
-
icon="i-lucide-heart-handshake"
|
|
227
|
-
:to="`https://github.com/sponsors/${sponsors.username}`"
|
|
228
|
-
target="_blank"
|
|
229
|
-
color="neutral"
|
|
230
|
-
>
|
|
231
|
-
Become a Sponsor
|
|
232
|
-
</UButton>
|
|
233
|
-
</div>
|
|
234
|
-
</UPageSection>
|
|
235
|
-
|
|
236
|
-
<UPageSection v-if="contributors?.length" id="contributors" title="Contributors">
|
|
237
|
-
<div class="flex flex-wrap justify-center gap-2">
|
|
238
|
-
<UTooltip v-for="c in contributors" :key="c.username" :text="c.name" :delay-duration="0">
|
|
239
|
-
<a :href="c.profile" target="_blank" class="opacity-80 hover:opacity-100">
|
|
240
|
-
<UAvatar :alt="c.name" :src="c.avatar" size="3xl" />
|
|
241
|
-
</a>
|
|
242
|
-
</UTooltip>
|
|
243
|
-
</div>
|
|
244
|
-
<div class="text-center">
|
|
245
|
-
<UButton
|
|
246
|
-
v-if="landing._github"
|
|
247
|
-
:to="`https://github.com/${landing._github}`"
|
|
248
|
-
target="_blank"
|
|
249
|
-
color="neutral"
|
|
250
|
-
icon="i-lucide-git-pull-request"
|
|
251
|
-
>
|
|
252
|
-
Contribute on GitHub
|
|
253
|
-
</UButton>
|
|
254
|
-
</div>
|
|
255
|
-
</UPageSection>
|
|
177
|
+
<PageSponsors v-if="docsConfig.sponsors?.api" />
|
|
178
|
+
<PageContributors v-if="docsConfig.landing?.contributors" />
|
|
256
179
|
</div>
|
|
257
180
|
</template>
|