docus 3.0.0-beta.2 → 3.0.0-beta.5
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 +12 -19
- package/{app → theme/app}/router.options.ts +0 -0
- package/{assets → theme/assets}/css/fonts.css +0 -0
- package/theme/assets/css/main.css +104 -0
- package/{components → theme/components}/app/Container.vue +0 -0
- package/{components → theme/components}/app/Footer.vue +4 -4
- package/theme/components/app/MobileNav.vue +83 -0
- package/theme/components/app/Navbar.vue +37 -0
- package/{components → theme/components}/app/NavbarLogo.vue +4 -4
- package/{components → theme/components}/app/Page.vue +0 -0
- package/{components → theme/components}/app/PoweredByDocus.vue +0 -0
- package/{components → theme/components}/content/Alert.vue +0 -0
- package/{components → theme/components}/content/BlockHero.vue +0 -0
- package/{components → theme/components}/content/ButtonLink.vue +1 -1
- package/{components → theme/components}/content/Card.vue +0 -0
- package/{components → theme/components}/content/CardGrid.vue +0 -0
- package/{components → theme/components}/content/CodeBlock.vue +0 -0
- package/{components → theme/components}/content/CodeGroup.vue +6 -6
- package/{components → theme/components}/content/CopyButton.vue +0 -0
- package/{components → theme/components}/content/List.vue +0 -0
- package/{components → theme/components}/content/NeedContribution.vue +0 -0
- package/{components → theme/components}/content/ReadMore.vue +0 -0
- package/{components → theme/components}/content/Sandbox.vue +2 -2
- package/{components → theme/components}/content/TabsHeader.vue +2 -2
- package/{components → theme/components}/content/Terminal.vue +0 -0
- package/{components → theme/components}/content/VideoPlayer.vue +0 -0
- package/theme/components/dev/Debug.vue +63 -0
- package/{components → theme/components}/docs/DocsAside.vue +2 -2
- package/{components → theme/components}/docs/DocsAsideTree.vue +8 -6
- package/{components → theme/components}/docs/DocsHero.vue +0 -0
- package/{components → theme/components}/docs/DocsPage.vue +0 -1
- package/theme/components/docs/DocsPageContent.vue +32 -0
- package/{components → theme/components}/docs/DocsToc.vue +15 -12
- package/{components → theme/components}/globals/Icon.vue +0 -0
- package/{components → theme/components}/globals/Logo.vue +0 -0
- package/{components → theme/components}/globals/NuxtImg.vue +0 -0
- package/{components → theme/components}/globals/SocialIcons.vue +2 -2
- package/{components → theme/components}/globals/ThemeSelect.vue +1 -1
- package/{components → theme/components}/icons/IconAlgolia.vue +0 -0
- package/{components → theme/components}/icons/IconArrowLeft.vue +0 -0
- package/{components → theme/components}/icons/IconArrowRight.vue +0 -0
- package/{components → theme/components}/icons/IconBadgeCheck.vue +0 -0
- package/{components → theme/components}/icons/IconCheck.vue +0 -0
- package/{components → theme/components}/icons/IconCheckCircle.vue +0 -0
- package/{components → theme/components}/icons/IconChevronRight.vue +0 -0
- package/{components → theme/components}/icons/IconClipboardCheck.vue +0 -0
- package/{components → theme/components}/icons/IconClipboardCopy.vue +0 -0
- package/{components → theme/components}/icons/IconCodeSandbox.vue +0 -0
- package/{components → theme/components}/icons/IconCopy.vue +0 -0
- package/{components → theme/components}/icons/IconDots.vue +0 -0
- package/{components → theme/components}/icons/IconEdit.vue +0 -0
- package/{components → theme/components}/icons/IconExclamationCircle.vue +0 -0
- package/{components → theme/components}/icons/IconExclamationTriangle.vue +0 -0
- package/{components → theme/components}/icons/IconExternalLink.vue +0 -0
- package/{components → theme/components}/icons/IconGit.vue +0 -0
- package/{components → theme/components}/icons/IconGitHub.vue +0 -0
- package/{components → theme/components}/icons/IconHeart.vue +0 -0
- package/{components → theme/components}/icons/IconInformationCircle.vue +0 -0
- package/{components → theme/components}/icons/IconLighthouse.vue +0 -0
- package/{components → theme/components}/icons/IconLine.vue +0 -0
- package/{components → theme/components}/icons/IconMarkdown.vue +0 -0
- package/{components → theme/components}/icons/IconMenu.vue +0 -0
- package/{components → theme/components}/icons/IconMenuAlt.vue +0 -0
- package/{components → theme/components}/icons/IconMinus.vue +0 -0
- package/{components → theme/components}/icons/IconMoon.vue +0 -0
- package/{components → theme/components}/icons/IconNuxt.vue +0 -0
- package/{components → theme/components}/icons/IconNuxtContent.vue +0 -0
- package/{components → theme/components}/icons/IconNuxtLabs.vue +0 -0
- package/{components → theme/components}/icons/IconPlus.vue +0 -0
- package/{components → theme/components}/icons/IconPuzzle.vue +0 -0
- package/{components → theme/components}/icons/IconSSG.vue +0 -0
- package/{components → theme/components}/icons/IconSearch.vue +0 -0
- package/{components → theme/components}/icons/IconSun.vue +0 -0
- package/theme/components/icons/IconTailwind.vue +3 -0
- package/{components → theme/components}/icons/IconTocBack.vue +0 -0
- package/{components → theme/components}/icons/IconTocCurrent.vue +0 -0
- package/{components → theme/components}/icons/IconTocNext.vue +0 -0
- package/{components → theme/components}/icons/IconTranslate.vue +0 -0
- package/{components → theme/components}/icons/IconTwitter.vue +0 -0
- package/{components → theme/components}/icons/IconVite.vue +0 -0
- package/{components → theme/components}/icons/IconVue.vue +0 -0
- package/{components → theme/components}/icons/IconVueTelescope.vue +0 -0
- package/{components → theme/components}/icons/IconWindi.vue +0 -0
- package/{components → theme/components}/icons/IconX.vue +0 -0
- package/{components → theme/components}/icons/IconXCircle.vue +0 -0
- package/{components → theme/components}/icons/IconZap.vue +0 -0
- package/{components → theme/components}/prose/ProseA.vue +3 -3
- package/{components → theme/components}/prose/ProseBlockquote.vue +1 -1
- package/{components → theme/components}/prose/ProseCode.vue +3 -4
- package/{components → theme/components}/prose/ProseCodeInline.vue +2 -2
- package/{components → theme/components}/prose/ProseEm.vue +0 -0
- package/{components → theme/components}/prose/ProseH1.vue +0 -0
- package/{components → theme/components}/prose/ProseH2.vue +0 -0
- package/{components → theme/components}/prose/ProseH3.vue +0 -0
- package/{components → theme/components}/prose/ProseH4.vue +0 -0
- package/{components → theme/components}/prose/ProseHr.vue +1 -1
- package/{components → theme/components}/prose/ProseImg.vue +0 -0
- package/{components → theme/components}/prose/ProseLi.vue +2 -2
- package/{components → theme/components}/prose/ProseOl.vue +0 -0
- package/{components → theme/components}/prose/ProseP.vue +0 -0
- package/{components → theme/components}/prose/ProseStrong.vue +0 -0
- package/{components → theme/components}/prose/ProseTable.vue +0 -0
- package/{components → theme/components}/prose/ProseTbody.vue +0 -0
- package/{components → theme/components}/prose/ProseTd.vue +0 -0
- package/{components → theme/components}/prose/ProseTh.vue +1 -1
- package/{components → theme/components}/prose/ProseThead.vue +1 -1
- package/{components → theme/components}/prose/ProseTr.vue +1 -1
- package/{components → theme/components}/prose/ProseUl.vue +0 -0
- package/theme/composables/useDocus.ts +42 -0
- package/theme/composables/useMenu.ts +7 -0
- package/{composables → theme/composables}/useScrollToHeading.ts +0 -0
- package/{composables → theme/composables}/useScrollspy.ts +0 -0
- package/theme/composables/useUserAgent.ts +5 -0
- package/{composables/useTheme.ts → theme/composables/utils.ts} +0 -8
- package/{layouts → theme/layouts}/default.vue +6 -8
- package/{layouts → theme/layouts}/page.vue +7 -1
- package/theme/middleware/components.ts +25 -0
- package/theme/middleware/navigation.global.ts +12 -0
- package/theme/middleware/page.ts +8 -0
- package/theme/middleware/theme.global.ts +12 -0
- package/{nuxt.config.ts → theme/nuxt.config.ts} +84 -64
- package/theme/pages/[...slug].vue +62 -0
- package/theme/plugins/menu.ts +65 -0
- package/theme/plugins/user-agent.ts +25 -0
- package/theme/utils/components.ts +25 -0
- package/theme/utils/navigation.ts +49 -0
- package/theme/utils/plugin.ts +21 -0
- package/theme/utils/queries.ts +68 -0
- package/theme/utils/state.ts +32 -0
- package/theme/utils/theme.ts +64 -0
- package/assets/css/main.css +0 -11
- package/assets/css/tailwind.css +0 -282
- package/components/app/Navbar.vue +0 -26
- package/components/docs/DocsPageContent.vue +0 -31
- package/composables/useContent.ts +0 -156
- package/composables/useMenu.ts +0 -22
- package/pages/[...slug].vue +0 -26
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/site.webmanifest +0 -1
package/assets/css/tailwind.css
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
5
|
-
@layer components {
|
|
6
|
-
/* Base */
|
|
7
|
-
.text-primary {
|
|
8
|
-
@apply text-gray-900 dark:text-gray-50;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.text-secondary {
|
|
12
|
-
@apply text-gray-500 dark:text-gray-400;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.text-secondary-active {
|
|
16
|
-
@apply text-primary-500 dark:text-primary-400;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.text-secondary-hover {
|
|
20
|
-
@apply hover:text-primary-500 hover:dark:text-primary-400;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.text-secondary-group-hover {
|
|
24
|
-
@apply group-hover:dark:text-primary-400 group-hover:text-primary-500;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.transition-base {
|
|
28
|
-
@apply transition-colors transition-opacity duration-100 ease-in-out;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Icons */
|
|
32
|
-
.icon-base {
|
|
33
|
-
@apply transition-base text-secondary text-secondary-hover;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* ProseA */
|
|
37
|
-
.d-prose-a-text {
|
|
38
|
-
@apply text-primary-500;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.d-prose-a-border {
|
|
42
|
-
@apply border-b border-transparent;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.d-prose-a-border-hover {
|
|
46
|
-
@apply border-b border-primary-500;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.d-prose-a-headline-border {
|
|
50
|
-
@apply border-b border-dashed border-gray-900 dark:border-gray-100;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* ProseBlockquote */
|
|
54
|
-
.d-prose-blockquote-border {
|
|
55
|
-
@apply border-l-2 border-gray-200 dark:border-gray-700;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.d-prose-blockquote-text {
|
|
59
|
-
@apply text-secondary;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** UNCONVERTED **/
|
|
63
|
-
.d-body-bg {
|
|
64
|
-
@apply bg-white dark:bg-gray-900;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.d-body-text-color {
|
|
68
|
-
@apply text-gray-900 dark:text-gray-50;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.d-secondary-bg {
|
|
72
|
-
@apply bg-gray-500 dark:bg-gray-400;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.d-secondary-text {
|
|
76
|
-
@apply text-gray-500 dark:text-gray-400;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.d-secondary-text-hover {
|
|
80
|
-
@apply text-primary-500 dark:text-primary-400;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.d-tertiary-text {
|
|
84
|
-
@apply text-gray-400 dark:text-gray-500;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.d-border-tertiary {
|
|
88
|
-
@apply border-gray-400 dark:border-gray-500;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.d-primary-text-hover {
|
|
92
|
-
@apply text-gray-600 dark:text-gray-400;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.d-secondary-text-active {
|
|
96
|
-
@apply text-gray-900 dark:text-gray-300;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.d-prose-code-inline-bg {
|
|
100
|
-
background-color: #282c34;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.d-prose-code-bg {
|
|
104
|
-
background-color: #282c34;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.d-prose-thead-border {
|
|
108
|
-
@apply border-b border-gray-200 dark:border-gray-700;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.d-prose-tr-border {
|
|
112
|
-
@apply border-b border-gray-100 dark:border-gray-800;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.d-prose-blockquote-border {
|
|
116
|
-
@apply border-l-2 border-gray-200 dark:border-gray-700;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.d-prose-blockquote-text {
|
|
120
|
-
@apply d-secondary-text;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.d-prose-a-text {
|
|
124
|
-
@apply text-primary-500;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.d-prose-a-border {
|
|
128
|
-
@apply border-b border-transparent;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.d-prose-a-border-hover {
|
|
132
|
-
@apply border-b border-primary-500;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.d-prose-a-headline-border {
|
|
136
|
-
@apply border-b border-dashed border-gray-900 dark:border-gray-100;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.d-text-primary {
|
|
140
|
-
@apply text-primary-500 dark:text-primary-400;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.d-border-primary {
|
|
144
|
-
@apply border-primary-500 dark:border-primary-400;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.d-bg-primary {
|
|
148
|
-
@apply bg-primary-500 dark:bg-primary-400;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.d-page-mobile-toc-bg {
|
|
152
|
-
@apply bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.d-aside-header-bg {
|
|
156
|
-
@apply bg-gray-50 dark:bg-gray-800;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.d-active-aside-navigation-item-bg {
|
|
160
|
-
@apply bg-primary-50 dark:bg-primary-900;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.d-active-aside-navigation-item-text {
|
|
164
|
-
@apply text-primary-500 dark:text-primary-400 ;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.d-code-group-header-bg {
|
|
168
|
-
@apply bg-gray-200 dark:bg-gray-700;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.d-code-group-tab {
|
|
172
|
-
@apply bg-gray-300 dark:bg-gray-600;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.d-prose-code-inline-in-heading-border-hover {
|
|
176
|
-
@apply border-gray-500 dark:border-gray-200;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.d-prose-hr-border {
|
|
180
|
-
@apply border-t border-gray-100 dark:border-gray-800;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.d-prose-ul-li-bullet {
|
|
184
|
-
@apply d-secondary-bg;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.d-text-icon {
|
|
188
|
-
@apply d-secondary-text hover:d-secondary-text-hover;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.d-icon {
|
|
192
|
-
@apply d-text-icon focus:outline-none;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.light-img {
|
|
196
|
-
@apply dark:hidden;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.dark-img {
|
|
200
|
-
@apply light:hidden;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.d-max-w-container {
|
|
204
|
-
@apply max-w-7xl;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.d-px-container {
|
|
208
|
-
@apply px-4 sm:px-6;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.d-container {
|
|
212
|
-
@apply d-max-w-container mx-auto;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.d-container-content {
|
|
216
|
-
@apply d-container d-px-container;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.d-blur-header {
|
|
220
|
-
@apply blur-12;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.d-bg-header {
|
|
224
|
-
@apply bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.d-border {
|
|
228
|
-
@apply light:border-gray-200 light:border-opacity-50 dark:border-gray-800;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.d-border-hover {
|
|
232
|
-
@apply border-primary-200 dark:border-gray-700;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.d-border-header {
|
|
236
|
-
@apply border-b border-gray-200 dark:border-gray-800 border-opacity-50;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.d-header {
|
|
240
|
-
@apply sticky w-full top-0 z-50 d-bg-header d-border-header d-blur-header h-header;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.d-header-title {
|
|
244
|
-
@apply text-2xl font-bold tracking-tighter text-gray-900 dark:text-gray-100;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.d-header-title-logo {
|
|
248
|
-
@apply d-header-title ml-4;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.d-header-logo {
|
|
252
|
-
@apply flex items-center flex-none lg:w-60;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.d-logo-color {
|
|
256
|
-
@apply text-black dark:text-white;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.d-logo {
|
|
260
|
-
@apply w-auto h-6 md:h-8 d-logo-color;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.d-heading-title {
|
|
264
|
-
@apply !mb-0 !mt-0 flex-1 !text-4xl font-semibold tracking-tight;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.d-heading-description {
|
|
268
|
-
@apply !mt-2 !mb-0 text-lg font-medium d-secondary-text;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.d-heading-hr {
|
|
272
|
-
@apply !mt-4 !mb-0 d-border;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.d-aside-title {
|
|
276
|
-
@apply py-2 text-base font-semibold text-gray-900 cursor-pointer dark:text-gray-100;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.d-badge {
|
|
280
|
-
@apply text-gray-600 dark:text-gray-400 bg-gray-900;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<header class="sticky w-full h-[4rem] top-0 z-50 bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 border-b border-gray-200 dark:border-gray-800 border-opacity-50 sticky w-full top-0 z-50 backdrop-blur supports-backdrop-blur:bg-white/95">
|
|
3
|
-
<Container class="flex flex-none h-full">
|
|
4
|
-
<!-- <NavigationButton v-if="aside" /> -->
|
|
5
|
-
|
|
6
|
-
<div class="justify-center flex items-center flex-1 lg:flex-none">
|
|
7
|
-
<NavbarLogo />
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div class="items-center hidden lg:flex lg:flex-1">
|
|
11
|
-
<!-- <HeaderNavigation /> -->
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<!-- Desktop: Right section -->
|
|
15
|
-
<div class="flex items-center justify-end lg:flex-none">
|
|
16
|
-
<!-- <ColorSwitcher /> -->
|
|
17
|
-
|
|
18
|
-
<div class="items-center justify-end hidden lg:flex">
|
|
19
|
-
<!-- <LangSwitcher /> -->
|
|
20
|
-
<ThemeSelect />
|
|
21
|
-
<!-- <SocialIcons /> -->
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</Container>
|
|
25
|
-
</header>
|
|
26
|
-
</template>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, useContent } from '#imports'
|
|
3
|
-
|
|
4
|
-
const { page } = useContent()
|
|
5
|
-
|
|
6
|
-
const isOpen = ref(false)
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<div class="flex flex-col-reverse lg:grid lg:grid-cols-10 gap-8 relative">
|
|
11
|
-
<div
|
|
12
|
-
class="col-span-10 lg:col-span-8"
|
|
13
|
-
>
|
|
14
|
-
<slot />
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<div
|
|
18
|
-
class="lg:col-span-2 lg:self-start overflow-x-hidden sticky top-16 -mx-4 sm:-mx-6 px-4 sm:px-6 lg:mx-0 lg:px-0 lg:pt-8 lg:-mt-8 backdrop-blur-md lg:max-h-[calc(100vh-64px)]"
|
|
19
|
-
>
|
|
20
|
-
<div class="py-4 lg:py-0">
|
|
21
|
-
<button class="flex lg:hidden items-center gap-3" @click="isOpen = !isOpen">
|
|
22
|
-
<span class="u-text-gray-900 font-semibold text-sm">Table of Contents</span>
|
|
23
|
-
|
|
24
|
-
<Icon name="heroicons-outline:chevron-right" class="w-4 h-4 u-text-gray-400 transition-transform duration-100 transform" :class="[isOpen ? 'rotate-90' : 'rotate-0']" />
|
|
25
|
-
</button>
|
|
26
|
-
|
|
27
|
-
<DocsToc class="mt-4 lg:mt-0" :class="[isOpen ? 'lg:block' : 'hidden lg:block']" />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { withoutTrailingSlash } from 'ufo'
|
|
2
|
-
import type { NavItem, ParsedContent } from '@nuxt/content/dist/runtime/types'
|
|
3
|
-
import { computed, fetchContentNavigation, onBeforeUnmount, onMounted, queryContent, useNuxtApp, useRoute, useState } from '#imports'
|
|
4
|
-
|
|
5
|
-
let closeHook
|
|
6
|
-
|
|
7
|
-
export const useContent = () => {
|
|
8
|
-
const route = useRoute()
|
|
9
|
-
|
|
10
|
-
const path = computed(() => withoutTrailingSlash(route.path))
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Navigation tree from root of app.
|
|
14
|
-
*/
|
|
15
|
-
const navigation = useState<NavItem[]>('navigation', () => null)
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Current page complete data.
|
|
19
|
-
*/
|
|
20
|
-
const page = useState<ParsedContent>(`content-page-${path.value}`, () => null)
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Previous and next page data.
|
|
24
|
-
* Format: [prev, next]
|
|
25
|
-
*/
|
|
26
|
-
const surround = useState<ParsedContent[]>(`content-surround-${path.value}`, () => null)
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Table of contents from parsed page.
|
|
30
|
-
*/
|
|
31
|
-
const toc = computed(() => page?.value?.body?.toc?.links || [])
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Content type from parsed page.
|
|
35
|
-
*/
|
|
36
|
-
const type = computed(() => page.value?.meta?.type)
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Next page from `surround`.
|
|
40
|
-
*/
|
|
41
|
-
const next = computed(() => surround.value?.[1] || null)
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Previous page from `surround`.
|
|
45
|
-
*/
|
|
46
|
-
const prev = computed(() => surround.value?.[0] || null)
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Page list fetching helper.
|
|
50
|
-
*/
|
|
51
|
-
const fetchDir = async(path: string) => await queryContent(path).find()
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Find first child link from a navigation node.
|
|
55
|
-
*/
|
|
56
|
-
const findBottomLink = (link: NavItem) => {
|
|
57
|
-
let slug = link.slug
|
|
58
|
-
|
|
59
|
-
if (link.children && link.children.length)
|
|
60
|
-
slug = findBottomLink(link.children[0])
|
|
61
|
-
|
|
62
|
-
return slug
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Find current navigation node from a path.
|
|
67
|
-
*/
|
|
68
|
-
const navFromPath = (path: string, tree: NavItem[] = navigation.value) => {
|
|
69
|
-
for (const file of tree) {
|
|
70
|
-
if (file.children) {
|
|
71
|
-
const result = navFromPath(path, file.children)
|
|
72
|
-
if (result)
|
|
73
|
-
return result
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (file.slug === path)
|
|
77
|
-
return file
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Navigation fetching helper.
|
|
83
|
-
*/
|
|
84
|
-
const fetchNavigation = async(force = false) => {
|
|
85
|
-
if (navigation.value !== null && !force)
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
navigation.value = await fetchContentNavigation()
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Local page fetching helper.
|
|
93
|
-
*/
|
|
94
|
-
const fetchPage = async(force = false) => {
|
|
95
|
-
if (page.value !== null && !force)
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
const splitted = path.value.split('/')
|
|
99
|
-
const directory = splitted.slice(0, splitted.length - 1).join('/')
|
|
100
|
-
|
|
101
|
-
// Get navigation node from current path
|
|
102
|
-
const file = navFromPath(path.value, navigation.value)
|
|
103
|
-
|
|
104
|
-
if (file && !file.children) {
|
|
105
|
-
// Path queried has a page (and is not a directory)
|
|
106
|
-
await Promise.all([
|
|
107
|
-
queryContent().where({ id: file.id }).findOne() as Promise<ParsedContent>,
|
|
108
|
-
queryContent(directory).findSurround(path.value) as Promise<ParsedContent[]>,
|
|
109
|
-
]).then(([_page, _surround]) => {
|
|
110
|
-
page.value = _page
|
|
111
|
-
surround.value = _surround
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
else if (file) {
|
|
115
|
-
navigateTo(findBottomLink(file))
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Re-fetch page on change (development only)
|
|
120
|
-
if (process.dev) {
|
|
121
|
-
onMounted(
|
|
122
|
-
() => {
|
|
123
|
-
// Cleanup previous hook before registering new one.
|
|
124
|
-
if (closeHook)
|
|
125
|
-
closeHook()
|
|
126
|
-
|
|
127
|
-
const { hook } = useNuxtApp()
|
|
128
|
-
|
|
129
|
-
closeHook = hook('app:data:refresh', async() => {
|
|
130
|
-
await fetchNavigation(true)
|
|
131
|
-
await fetchPage(true)
|
|
132
|
-
})
|
|
133
|
-
},
|
|
134
|
-
)
|
|
135
|
-
onBeforeUnmount(() => closeHook && closeHook())
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return {
|
|
139
|
-
// useState references
|
|
140
|
-
navigation,
|
|
141
|
-
page,
|
|
142
|
-
surround,
|
|
143
|
-
// Fetching helpers
|
|
144
|
-
fetchDir,
|
|
145
|
-
fetchPage,
|
|
146
|
-
fetchNavigation,
|
|
147
|
-
// Computed values
|
|
148
|
-
next,
|
|
149
|
-
prev,
|
|
150
|
-
type,
|
|
151
|
-
toc,
|
|
152
|
-
// Methods
|
|
153
|
-
navFromPath,
|
|
154
|
-
findBottomLink,
|
|
155
|
-
}
|
|
156
|
-
}
|
package/composables/useMenu.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useState } from '#imports'
|
|
2
|
-
|
|
3
|
-
export const useMenu = () => {
|
|
4
|
-
// Menu visible reference
|
|
5
|
-
const visible = useState('menu-visible', () => false)
|
|
6
|
-
|
|
7
|
-
// Open the menu
|
|
8
|
-
const open = () => (visible.value = true)
|
|
9
|
-
|
|
10
|
-
// Close the menu
|
|
11
|
-
const close = () => (visible.value = false)
|
|
12
|
-
|
|
13
|
-
// Toggle the menu (useful for one-off buttons)
|
|
14
|
-
const toggle = () => (visible.value = !visible.value)
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
open,
|
|
18
|
-
close,
|
|
19
|
-
toggle,
|
|
20
|
-
visible,
|
|
21
|
-
}
|
|
22
|
-
}
|
package/pages/[...slug].vue
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useContent, useRouter } from '#imports'
|
|
3
|
-
|
|
4
|
-
const router = useRouter()
|
|
5
|
-
|
|
6
|
-
const { page, fetchPage } = useContent()
|
|
7
|
-
|
|
8
|
-
await fetchPage()
|
|
9
|
-
|
|
10
|
-
if (page.value && page.value.layout)
|
|
11
|
-
router.currentRoute.value.meta.layout = page.value.layout
|
|
12
|
-
else
|
|
13
|
-
router.currentRoute.value.meta.layout = 'default'
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<Content v-if="page" class="content" :document="page" />
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<style scoped>
|
|
21
|
-
.content {
|
|
22
|
-
& > :first-child {
|
|
23
|
-
margin-top: 0 !important;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/public/favicon-16x16.png
DELETED
|
Binary file
|
package/public/favicon-32x32.png
DELETED
|
Binary file
|
package/public/favicon.ico
DELETED
|
Binary file
|
package/public/site.webmanifest
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|