docus 1.0.7 → 2.0.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +23 -16
- package/app/app/app.config.ts +33 -0
- package/app/app/app.vue +54 -0
- package/app/app/assets/css/main.css +5 -0
- package/app/app/components/IconMenuToggle.vue +81 -0
- package/app/app/components/OgImage/OgImageDocs.vue +76 -0
- package/app/app/components/OgImage/OgImageLanding.vue +73 -0
- package/app/app/components/app/AppFooter.vue +40 -0
- package/app/app/components/app/AppHeader.vue +57 -0
- package/app/app/components/app/AppHeaderBody.vue +13 -0
- package/app/app/components/app/AppHeaderCTA.vue +3 -0
- package/app/app/components/app/AppHeaderCenter.vue +6 -0
- package/app/app/components/app/AppHeaderLogo.vue +16 -0
- package/app/app/components/docs/DocsAsideLeftTop.vue +3 -0
- package/app/app/components/docs/DocsAsideRightBottom.vue +17 -0
- package/app/app/components/docs/DocsPageHeaderLinks.vue +91 -0
- package/app/app/error.vue +42 -0
- package/app/app/layouts/docs.vue +25 -0
- package/app/app/pages/[...slug].vue +112 -0
- package/app/app/pages/index.vue +37 -0
- package/app/content.config.ts +31 -0
- package/app/nuxt.config.ts +29 -0
- package/app/nuxt.schema.ts +255 -0
- package/app/server/routes/raw/[...slug].md.get.ts +24 -0
- package/dist/main.mjs +238 -0
- package/package.json +59 -58
- package/dist/create-docus/create-docus.js +0 -7
- package/dist/create-docus/helpers.js +0 -244
- package/dist/create-docus/index.js +0 -87
- package/dist/index.js +0 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) NuxtLabs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
# Docus
|
|
1
|
+
# Docus
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Documentation Theme and CLI to write beautiful docs with Markdown.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ship fast, flexible, and SEO-optimized documentation with beautiful design out of the box. Docus brings together the best of the Nuxt ecosystem:
|
|
6
|
+
- [Nuxt 3](https://nuxt.com)
|
|
7
|
+
- [Nuxt Content](https://content.nuxt.com/)
|
|
8
|
+
- [Nuxt UI](https://ui.nuxt.com/)
|
|
9
|
+
- [Nuxt Image](https://image.nuxt.com/)
|
|
10
|
+
- [Nuxt LLMs](https://github.com/nuxtlabs/nuxt-llms)
|
|
11
|
+
- [UnJS ecosystem](https://unjs.io/)
|
|
12
|
+
- [Nuxt Studio](https://content.nuxt.com/studio)
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
## Contribution
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
yarn install --global docus
|
|
12
|
-
# Using NPM
|
|
13
|
-
npm install --global docus
|
|
14
|
-
```
|
|
16
|
+
<details>
|
|
17
|
+
<summary>Local development</summary>
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
- Clone this repository
|
|
20
|
+
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
|
|
21
|
+
- Install dependencies using `pnpm install`
|
|
22
|
+
- Run prepare command using `pnpm run dev:prepare`
|
|
23
|
+
- Run dev documentation built on top of Docus using `pnpm run dev`
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
</details>
|
|
19
26
|
|
|
20
|
-
##
|
|
27
|
+
## License
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
Published under the [MIT](https://github.com/unjs/undocs/blob/main/LICENSE) license.
|
|
30
|
+
|
|
31
|
+
Docus v2 has been entirely rewritten from scratch and is inspired and copied from [undocs](https://github.com/unjs/undocs) made by [@pi0](https://github.com/pi0) 💚
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default defineAppConfig({
|
|
2
|
+
ui: {
|
|
3
|
+
colors: {
|
|
4
|
+
primary: 'emerald',
|
|
5
|
+
neutral: 'zinc',
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
uiPro: {
|
|
9
|
+
contentNavigation: {
|
|
10
|
+
slots: {
|
|
11
|
+
linkLeadingIcon: 'size-4 mr-1',
|
|
12
|
+
listWithChildren: 'border-(--ui-bg-elevated)',
|
|
13
|
+
linkTrailing: 'hidden',
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
active: {
|
|
17
|
+
false: {
|
|
18
|
+
link: 'text-toned hover:after:bg-accented',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
pageLinks: {
|
|
24
|
+
slots: {
|
|
25
|
+
linkLeadingIcon: 'size-4',
|
|
26
|
+
linkLabelExternalIcon: 'size-2.5',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
toc: {
|
|
31
|
+
title: 'On this page',
|
|
32
|
+
},
|
|
33
|
+
})
|
package/app/app/app.vue
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { seo } = useAppConfig()
|
|
3
|
+
const site = useSiteConfig()
|
|
4
|
+
|
|
5
|
+
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs'))
|
|
6
|
+
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
|
|
7
|
+
server: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
useHead({
|
|
11
|
+
meta: [
|
|
12
|
+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
13
|
+
],
|
|
14
|
+
link: [
|
|
15
|
+
{ rel: 'icon', href: '/favicon.ico' },
|
|
16
|
+
],
|
|
17
|
+
htmlAttrs: {
|
|
18
|
+
lang: 'en',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
useSeoMeta({
|
|
23
|
+
titleTemplate: seo.titleTemplate,
|
|
24
|
+
title: seo.title,
|
|
25
|
+
description: seo.description,
|
|
26
|
+
ogSiteName: site.name,
|
|
27
|
+
twitterCard: 'summary_large_image',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
provide('navigation', navigation)
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<UApp>
|
|
35
|
+
<NuxtLoadingIndicator color="var(--ui-primary)" />
|
|
36
|
+
|
|
37
|
+
<AppHeader />
|
|
38
|
+
|
|
39
|
+
<UMain>
|
|
40
|
+
<NuxtLayout>
|
|
41
|
+
<NuxtPage />
|
|
42
|
+
</NuxtLayout>
|
|
43
|
+
</UMain>
|
|
44
|
+
|
|
45
|
+
<AppFooter />
|
|
46
|
+
|
|
47
|
+
<ClientOnly>
|
|
48
|
+
<LazyUContentSearch
|
|
49
|
+
:files="files"
|
|
50
|
+
:navigation="navigation"
|
|
51
|
+
/>
|
|
52
|
+
</ClientOnly>
|
|
53
|
+
</UApp>
|
|
54
|
+
</template>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { motion } from 'motion-v'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
open: boolean
|
|
6
|
+
}>()
|
|
7
|
+
|
|
8
|
+
const lineVariants = {
|
|
9
|
+
normal: {
|
|
10
|
+
rotate: 0,
|
|
11
|
+
y: 0,
|
|
12
|
+
opacity: 1,
|
|
13
|
+
},
|
|
14
|
+
close: (custom: number) => ({
|
|
15
|
+
rotate: custom === 1 ? 45 : custom === 3 ? -45 : 0,
|
|
16
|
+
y: custom === 1 ? 6 : custom === 3 ? -6 : 0,
|
|
17
|
+
opacity: custom === 2 ? 0 : 1,
|
|
18
|
+
transition: {
|
|
19
|
+
type: 'spring',
|
|
20
|
+
stiffness: 260,
|
|
21
|
+
damping: 20,
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const state = computed(() => {
|
|
27
|
+
return props.open ? 'close' : 'normal'
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<UButton
|
|
33
|
+
size="sm"
|
|
34
|
+
variant="ghost"
|
|
35
|
+
color="neutral"
|
|
36
|
+
class="-me-1.5"
|
|
37
|
+
square
|
|
38
|
+
>
|
|
39
|
+
<svg
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
+
class="size-5"
|
|
42
|
+
viewBox="0 0 24 24"
|
|
43
|
+
fill="none"
|
|
44
|
+
stroke="currentColor"
|
|
45
|
+
stroke-width="2"
|
|
46
|
+
stroke-linecap="round"
|
|
47
|
+
stroke-linejoin="round"
|
|
48
|
+
>
|
|
49
|
+
<motion.line
|
|
50
|
+
x1="4"
|
|
51
|
+
y1="6"
|
|
52
|
+
x2="20"
|
|
53
|
+
y2="6"
|
|
54
|
+
:variants="lineVariants"
|
|
55
|
+
:animate="state"
|
|
56
|
+
:custom="1"
|
|
57
|
+
class="outline-none"
|
|
58
|
+
/>
|
|
59
|
+
<motion.line
|
|
60
|
+
x1="4"
|
|
61
|
+
y1="12"
|
|
62
|
+
x2="20"
|
|
63
|
+
y2="12"
|
|
64
|
+
:variants="lineVariants"
|
|
65
|
+
:animate="state"
|
|
66
|
+
:custom="2"
|
|
67
|
+
class="outline-none"
|
|
68
|
+
/>
|
|
69
|
+
<motion.line
|
|
70
|
+
x1="4"
|
|
71
|
+
y1="18"
|
|
72
|
+
x2="20"
|
|
73
|
+
y2="18"
|
|
74
|
+
:variants="lineVariants"
|
|
75
|
+
:animate="state"
|
|
76
|
+
:custom="3"
|
|
77
|
+
class="outline-none"
|
|
78
|
+
/>
|
|
79
|
+
</svg>
|
|
80
|
+
</UButton>
|
|
81
|
+
</template>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const props = withDefaults(defineProps<{ title?: string, description?: string, headline?: string }>(), {
|
|
3
|
+
title: 'title',
|
|
4
|
+
description: 'description',
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const title = computed(() => (props.title || '').slice(0, 60))
|
|
8
|
+
const description = computed(() => (props.description || '').slice(0, 200))
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="w-full h-full flex flex-col justify-center bg-neutral-900">
|
|
13
|
+
<svg
|
|
14
|
+
class="absolute right-0 top-0 opacity-50"
|
|
15
|
+
width="629"
|
|
16
|
+
height="593"
|
|
17
|
+
viewBox="0 0 629 593"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
>
|
|
21
|
+
<g filter="url(#filter0_f_199_94966)">
|
|
22
|
+
<path
|
|
23
|
+
d="M628.5 -578L639.334 -94.4223L806.598 -548.281L659.827 -87.387L965.396 -462.344L676.925 -74.0787L1087.69 -329.501L688.776 -55.9396L1160.22 -164.149L694.095 -34.9354L1175.13 15.7948L692.306 -13.3422L1130.8 190.83L683.602 6.50012L1032.04 341.989L668.927 22.4412L889.557 452.891L649.872 32.7537L718.78 511.519L628.5 36.32L538.22 511.519L607.128 32.7537L367.443 452.891L588.073 22.4412L224.955 341.989L573.398 6.50012L126.198 190.83L564.694 -13.3422L81.8734 15.7948L562.905 -34.9354L96.7839 -164.149L568.224 -55.9396L169.314 -329.501L580.075 -74.0787L291.604 -462.344L597.173 -87.387L450.402 -548.281L617.666 -94.4223L628.5 -578Z"
|
|
24
|
+
fill="white"
|
|
25
|
+
/>
|
|
26
|
+
</g>
|
|
27
|
+
<defs>
|
|
28
|
+
<filter
|
|
29
|
+
id="filter0_f_199_94966"
|
|
30
|
+
x="0.873535"
|
|
31
|
+
y="-659"
|
|
32
|
+
width="1255.25"
|
|
33
|
+
height="1251.52"
|
|
34
|
+
filterUnits="userSpaceOnUse"
|
|
35
|
+
color-interpolation-filters="sRGB"
|
|
36
|
+
>
|
|
37
|
+
<feFlood
|
|
38
|
+
flood-opacity="0"
|
|
39
|
+
result="BackgroundImageFix"
|
|
40
|
+
/>
|
|
41
|
+
<feBlend
|
|
42
|
+
mode="normal"
|
|
43
|
+
in="SourceGraphic"
|
|
44
|
+
in2="BackgroundImageFix"
|
|
45
|
+
result="shape"
|
|
46
|
+
/>
|
|
47
|
+
<feGaussianBlur
|
|
48
|
+
stdDeviation="40.5"
|
|
49
|
+
result="effect1_foregroundBlur_199_94966"
|
|
50
|
+
/>
|
|
51
|
+
</filter>
|
|
52
|
+
</defs>
|
|
53
|
+
</svg>
|
|
54
|
+
|
|
55
|
+
<div class="pl-[100px]">
|
|
56
|
+
<p
|
|
57
|
+
v-if="headline"
|
|
58
|
+
class="uppercase text-[24px] text-emerald-500 mb-4 font-semibold"
|
|
59
|
+
>
|
|
60
|
+
{{ headline }}
|
|
61
|
+
</p>
|
|
62
|
+
<h1
|
|
63
|
+
v-if="title"
|
|
64
|
+
class="m-0 text-[75px] font-semibold mb-4 text-white flex items-center"
|
|
65
|
+
>
|
|
66
|
+
<span>{{ title }}</span>
|
|
67
|
+
</h1>
|
|
68
|
+
<p
|
|
69
|
+
v-if="description"
|
|
70
|
+
class="text-[32px] text-neutral-300 leading-tight w-[700px]"
|
|
71
|
+
>
|
|
72
|
+
{{ description }}
|
|
73
|
+
</p>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const props = withDefaults(defineProps<{ title?: string, description?: string, headline?: string }>(), {
|
|
3
|
+
title: 'title',
|
|
4
|
+
description: 'description',
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const title = computed(() => (props.title || '').slice(0, 60))
|
|
8
|
+
const description = computed(() => (props.description || '').slice(0, 200))
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="w-full h-full flex items-center justify-center bg-neutral-900">
|
|
13
|
+
<svg
|
|
14
|
+
class="absolute right-0 top-0 opacity-50 "
|
|
15
|
+
width="629"
|
|
16
|
+
height="593"
|
|
17
|
+
viewBox="0 0 629 593"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
>
|
|
21
|
+
<g filter="url(#filter0_f_199_94966)">
|
|
22
|
+
<path
|
|
23
|
+
d="M628.5 -578L639.334 -94.4223L806.598 -548.281L659.827 -87.387L965.396 -462.344L676.925 -74.0787L1087.69 -329.501L688.776 -55.9396L1160.22 -164.149L694.095 -34.9354L1175.13 15.7948L692.306 -13.3422L1130.8 190.83L683.602 6.50012L1032.04 341.989L668.927 22.4412L889.557 452.891L649.872 32.7537L718.78 511.519L628.5 36.32L538.22 511.519L607.128 32.7537L367.443 452.891L588.073 22.4412L224.955 341.989L573.398 6.50012L126.198 190.83L564.694 -13.3422L81.8734 15.7948L562.905 -34.9354L96.7839 -164.149L568.224 -55.9396L169.314 -329.501L580.075 -74.0787L291.604 -462.344L597.173 -87.387L450.402 -548.281L617.666 -94.4223L628.5 -578Z"
|
|
24
|
+
fill="white"
|
|
25
|
+
/>
|
|
26
|
+
</g>
|
|
27
|
+
<defs>
|
|
28
|
+
<filter
|
|
29
|
+
id="filter0_f_199_94966"
|
|
30
|
+
x="0.873535"
|
|
31
|
+
y="-659"
|
|
32
|
+
width="1255.25"
|
|
33
|
+
height="1251.52"
|
|
34
|
+
filterUnits="userSpaceOnUse"
|
|
35
|
+
color-interpolation-filters="sRGB"
|
|
36
|
+
>
|
|
37
|
+
<feFlood
|
|
38
|
+
flood-opacity="0"
|
|
39
|
+
result="BackgroundImageFix"
|
|
40
|
+
/>
|
|
41
|
+
<feBlend
|
|
42
|
+
mode="normal"
|
|
43
|
+
in="SourceGraphic"
|
|
44
|
+
in2="BackgroundImageFix"
|
|
45
|
+
result="shape"
|
|
46
|
+
/>
|
|
47
|
+
<feGaussianBlur
|
|
48
|
+
stdDeviation="40.5"
|
|
49
|
+
result="effect1_foregroundBlur_199_94966"
|
|
50
|
+
/>
|
|
51
|
+
</filter>
|
|
52
|
+
</defs>
|
|
53
|
+
</svg>
|
|
54
|
+
|
|
55
|
+
<div class="flex flex-col justify-center p-8">
|
|
56
|
+
<div class="flex justify-center mb-8">
|
|
57
|
+
<AppHeaderLogo white />
|
|
58
|
+
</div>
|
|
59
|
+
<h1
|
|
60
|
+
v-if="title"
|
|
61
|
+
class="flex justify-center m-0 text-5xl font-semibold mb-4 text-white"
|
|
62
|
+
>
|
|
63
|
+
<span>{{ title }}</span>
|
|
64
|
+
</h1>
|
|
65
|
+
<p
|
|
66
|
+
v-if="description"
|
|
67
|
+
class="text-center text-2xl text-neutral-300 leading-tight"
|
|
68
|
+
>
|
|
69
|
+
{{ description }}
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
|
|
4
|
+
const links = computed(() => [
|
|
5
|
+
...Object.entries(appConfig.socials || {}).map(([key, url]) => ({
|
|
6
|
+
'icon': `i-simple-icons-${key}`,
|
|
7
|
+
'to': url,
|
|
8
|
+
'target': '_blank',
|
|
9
|
+
'aria-label': `${key} social link`,
|
|
10
|
+
})),
|
|
11
|
+
appConfig.github?.url && {
|
|
12
|
+
'icon': 'i-simple-icons-github',
|
|
13
|
+
'to': appConfig.github.url,
|
|
14
|
+
'target': '_blank',
|
|
15
|
+
'aria-label': 'GitHub repository',
|
|
16
|
+
},
|
|
17
|
+
].filter(Boolean))
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<UFooter>
|
|
22
|
+
<template #left>
|
|
23
|
+
<div class="text-sm text-muted">
|
|
24
|
+
Copyright © {{ new Date().getFullYear() }}
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<template #right>
|
|
29
|
+
<template v-if="links.length">
|
|
30
|
+
<UButton
|
|
31
|
+
v-for="(link, index) of links"
|
|
32
|
+
:key="index"
|
|
33
|
+
size="sm"
|
|
34
|
+
v-bind="{ color: 'neutral', variant: 'ghost', ...link }"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
37
|
+
<UColorModeButton />
|
|
38
|
+
</template>
|
|
39
|
+
</UFooter>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
const site = useSiteConfig()
|
|
4
|
+
|
|
5
|
+
const links = computed(() => appConfig.github?.url
|
|
6
|
+
? [
|
|
7
|
+
{
|
|
8
|
+
'icon': 'i-simple-icons-github',
|
|
9
|
+
'to': appConfig.github.url,
|
|
10
|
+
'target': '_blank',
|
|
11
|
+
'aria-label': 'GitHub',
|
|
12
|
+
},
|
|
13
|
+
]
|
|
14
|
+
: [])
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UHeader
|
|
19
|
+
:ui="{ center: 'flex-1' }"
|
|
20
|
+
to="/"
|
|
21
|
+
:title="appConfig.header?.title || site.name"
|
|
22
|
+
>
|
|
23
|
+
<AppHeaderCenter />
|
|
24
|
+
|
|
25
|
+
<template #title>
|
|
26
|
+
<AppHeaderLogo class="h-6 w-auto shrink-0" />
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<template #right>
|
|
30
|
+
<AppHeaderCTA />
|
|
31
|
+
|
|
32
|
+
<UContentSearchButton class="lg:hidden" />
|
|
33
|
+
|
|
34
|
+
<UColorModeButton />
|
|
35
|
+
|
|
36
|
+
<template v-if="links?.length">
|
|
37
|
+
<UButton
|
|
38
|
+
v-for="(link, index) of links"
|
|
39
|
+
:key="index"
|
|
40
|
+
v-bind="{ color: 'neutral', variant: 'ghost', ...link }"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<template #toggle="{ open, toggle }">
|
|
46
|
+
<IconMenuToggle
|
|
47
|
+
:open="open"
|
|
48
|
+
class="lg:hidden"
|
|
49
|
+
@click="toggle"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<template #body>
|
|
54
|
+
<AppHeaderBody />
|
|
55
|
+
</template>
|
|
56
|
+
</UHeader>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ContentNavigationItem } from '@nuxt/content'
|
|
3
|
+
|
|
4
|
+
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<UContentNavigation
|
|
9
|
+
highlight
|
|
10
|
+
variant="link"
|
|
11
|
+
:navigation="navigation"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<UColorModeImage
|
|
7
|
+
v-if="appConfig.header?.logo?.dark || appConfig.header?.logo?.light"
|
|
8
|
+
:light="appConfig.header?.logo?.light || appConfig.header?.logo?.dark"
|
|
9
|
+
:dark="appConfig.header?.logo?.dark || appConfig.header?.logo?.light"
|
|
10
|
+
:alt="appConfig.header?.logo?.alt || appConfig.header?.title"
|
|
11
|
+
class="h-6 w-auto shrink-0"
|
|
12
|
+
/>
|
|
13
|
+
<span v-else>
|
|
14
|
+
{{ appConfig.header?.title || '{appConfig.header.title}' }}
|
|
15
|
+
</span>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="appConfig.toc?.bottom?.links?.length"
|
|
4
|
+
class="hidden lg:block space-y-6"
|
|
5
|
+
>
|
|
6
|
+
<USeparator type="dashed" />
|
|
7
|
+
|
|
8
|
+
<UPageLinks
|
|
9
|
+
:title="appConfig.toc?.bottom?.title || 'Links'"
|
|
10
|
+
:links="appConfig.toc?.bottom?.links"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
const appConfig = useAppConfig()
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UButtonGroup>
|
|
3
|
+
<UButton
|
|
4
|
+
label="Copy page"
|
|
5
|
+
:icon="copyStatus === 'copied' ? 'i-lucide-copy-check' : 'i-lucide-copy'"
|
|
6
|
+
color="neutral"
|
|
7
|
+
variant="outline"
|
|
8
|
+
:loading="copyStatus === 'copying'"
|
|
9
|
+
size="xs"
|
|
10
|
+
:ui="{
|
|
11
|
+
leadingIcon: [copyStatus === 'copied' ? 'text-primary' : 'text-neutral', 'size-3.5'],
|
|
12
|
+
}"
|
|
13
|
+
@click="copyPage"
|
|
14
|
+
/>
|
|
15
|
+
<UDropdownMenu
|
|
16
|
+
size="sm"
|
|
17
|
+
:items="items"
|
|
18
|
+
:content="{
|
|
19
|
+
align: 'end',
|
|
20
|
+
side: 'bottom',
|
|
21
|
+
sideOffset: 8,
|
|
22
|
+
}"
|
|
23
|
+
:ui="{
|
|
24
|
+
content: 'w-48',
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
<UButton
|
|
28
|
+
icon="i-lucide-chevron-down"
|
|
29
|
+
size="sm"
|
|
30
|
+
color="neutral"
|
|
31
|
+
variant="outline"
|
|
32
|
+
/>
|
|
33
|
+
</UDropdownMenu>
|
|
34
|
+
</UButtonGroup>
|
|
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>
|