@wordup-md/nuxt-layer-shadcn-unocss 0.2.0
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/.cursor/rules/active-context-rule.mdc +8 -0
- package/.cursor/rules/memory-bank-overview.mdc +17 -0
- package/.cursor/rules/product-context-rule.mdc +8 -0
- package/.cursor/rules/progress-rule.mdc +8 -0
- package/.cursor/rules/projectbrief-rule.mdc +8 -0
- package/.cursor/rules/system-patterns-rule.mdc +8 -0
- package/.cursor/rules/tech-context-rule.mdc +8 -0
- package/.cursorrules +52 -0
- package/.editorconfig +12 -0
- package/.nuxtrc +1 -0
- package/.playground/app.config.ts +189 -0
- package/.playground/assets/style.css +15 -0
- package/.playground/components/content/MdcExample.vue +81 -0
- package/.playground/components/content/MdcReplay.vue +319 -0
- package/.playground/content/1.getting-started/1.introduction.md +8 -0
- package/.playground/content/1.getting-started/2.writing/1.markdown.md +56 -0
- package/.playground/content/1.getting-started/2.writing/2.pages.md +177 -0
- package/.playground/content/1.getting-started/2.writing/3.folders.md +56 -0
- package/.playground/content/1.getting-started/2.writing/_dir.yml +3 -0
- package/.playground/content/1.getting-started/_dir.yml +3 -0
- package/.playground/content/2.content-elements/1.text-formatting.md +60 -0
- package/.playground/content/2.content-elements/10.horizontal-rule.md +25 -0
- package/.playground/content/2.content-elements/11.tables.md +25 -0
- package/.playground/content/2.content-elements/12.overview.md +93 -0
- package/.playground/content/2.content-elements/13.text-components.md +36 -0
- package/.playground/content/2.content-elements/2.headings.md +32 -0
- package/.playground/content/2.content-elements/3.paragraphs.md +39 -0
- package/.playground/content/2.content-elements/4.lists.md +37 -0
- package/.playground/content/2.content-elements/5.links.md +17 -0
- package/.playground/content/2.content-elements/6.images.md +17 -0
- package/.playground/content/2.content-elements/7.blockquotes.md +17 -0
- package/.playground/content/2.content-elements/8.code-blocks.md +141 -0
- package/.playground/content/2.content-elements/9.inline-code.md +21 -0
- package/.playground/content/2.content-elements/_dir.yml +3 -0
- package/.playground/content/2.content-elements/index.md +8 -0
- package/.playground/content/3.components/1.index.md +187 -0
- package/.playground/content/3.components/2.docs/_dir.yml +3 -0
- package/.playground/content/3.components/2.docs/alert.md +152 -0
- package/.playground/content/3.components/2.docs/badge.md +131 -0
- package/.playground/content/3.components/2.docs/button-link.md +53 -0
- package/.playground/content/3.components/2.docs/callout.md +16 -0
- package/.playground/content/3.components/2.docs/code-group.md +77 -0
- package/.playground/content/3.components/2.docs/code-snippet.md +129 -0
- package/.playground/content/3.components/2.docs/field-group.md +62 -0
- package/.playground/content/3.components/2.docs/field.md +39 -0
- package/.playground/content/3.components/2.docs/file-tree.md +144 -0
- package/.playground/content/3.components/2.docs/icon.md +94 -0
- package/.playground/content/3.components/2.docs/pm.md +67 -0
- package/.playground/content/3.components/2.docs/read-more.md +44 -0
- package/.playground/content/3.components/2.docs/shortcut.md +36 -0
- package/.playground/content/3.components/2.docs/stack.md +81 -0
- package/.playground/content/3.components/2.docs/steps.md +148 -0
- package/.playground/content/3.components/2.docs/tabs.md +375 -0
- package/.playground/content/3.components/3.page/_dir.yml +2 -0
- package/.playground/content/3.components/3.page/accordion.md +74 -0
- package/.playground/content/3.components/3.page/card-group.md +115 -0
- package/.playground/content/3.components/3.page/card.md +142 -0
- package/.playground/content/3.components/3.page/collapsible.md +61 -0
- package/.playground/content/3.components/3.page/hero-alt.md +118 -0
- package/.playground/content/3.components/3.page/hero.md +60 -0
- package/.playground/content/3.components/3.page/team-card.md +82 -0
- package/.playground/content/3.components/_dir.yml +2 -0
- package/.playground/content/4.development/1.configuration/1.overview.md +297 -0
- package/.playground/content/4.development/1.configuration/2.nuxt-content.md +105 -0
- package/.playground/content/4.development/1.configuration/3.og-image.md +86 -0
- package/.playground/content/4.development/1.configuration/4.edit-link.md +63 -0
- package/.playground/content/4.development/1.configuration/5.banner.md +52 -0
- package/.playground/content/4.development/1.configuration/6.carbon-ads.md +65 -0
- package/.playground/content/4.development/1.configuration/7.umami.md +41 -0
- package/.playground/content/4.development/1.configuration/_dir.yml +3 -0
- package/.playground/content/4.development/2.advanced/1.override.md +49 -0
- package/.playground/content/4.development/2.advanced/2.math.md +89 -0
- package/.playground/content/4.development/2.advanced/_dir.yml +3 -0
- package/.playground/content/4.development/3.themes.md +9 -0
- package/.playground/content/4.development/4.composables.md +38 -0
- package/.playground/content/4.development/5.installation.md +36 -0
- package/.playground/content/4.development/_dir.yml +3 -0
- package/.playground/content/_menu-footer.md +5 -0
- package/.playground/content/index.md +67 -0
- package/.playground/content/test-card.md +187 -0
- package/.playground/content/test.md +88 -0
- package/.playground/content/test2.md +12 -0
- package/.playground/content/test3.md +187 -0
- package/.playground/nuxt.config.ts +52 -0
- package/.playground/public/banner-preview.png +0 -0
- package/.playground/public/favicon.ico +0 -0
- package/.playground/public/front-matter-showcase/authors.png +0 -0
- package/.playground/public/front-matter-showcase/badges.png +0 -0
- package/.playground/public/front-matter-showcase/nav-badges.png +0 -0
- package/.playground/public/hero.png +0 -0
- package/.playground/public/logo-dark.svg +12 -0
- package/.playground/public/logo.svg +12 -0
- package/.playground/public/og-nuxt-seo.png +0 -0
- package/.playground/public/og-nuxt.png +0 -0
- package/.playground/public/og-shadcn-docs-dark.png +0 -0
- package/.playground/public/og-shadcn-docs.png +0 -0
- package/.playground/public/sidebar-default.png +0 -0
- package/.playground/public/sidebar-group.png +0 -0
- package/.playground/public/sidebar-tree.png +0 -0
- package/.playground/uno.config.ts +16 -0
- package/README.md +93 -0
- package/app.vue +59 -0
- package/assets/css/a11y.css +48 -0
- package/assets/css/mdc-editor.css +91 -0
- package/components/A11yModeToggle.vue +23 -0
- package/components/DarkModeToggle.vue +26 -0
- package/components/LinkIcon.vue +32 -0
- package/components/OgImage/ShadcnDocs.vue +55 -0
- package/components/ThemeCustomizer.vue +156 -0
- package/components/ThemePopover.vue +27 -0
- package/components/content/Accordion.vue +18 -0
- package/components/content/AccordionItem.vue +32 -0
- package/components/content/Alert.vue +100 -0
- package/components/content/Badge.vue +52 -0
- package/components/content/ButtonLink.vue +38 -0
- package/components/content/Callout.vue +17 -0
- package/components/content/Card.vue +173 -0
- package/components/content/CardGroup.vue +38 -0
- package/components/content/CodeCopy.vue +52 -0
- package/components/content/CodeGroup._vue +27 -0
- package/components/content/CodeSnippet._vue +78 -0
- package/components/content/Collapsible.vue +80 -0
- package/components/content/Field.vue +53 -0
- package/components/content/FieldGroup.vue +5 -0
- package/components/content/FileTree.vue +110 -0
- package/components/content/FileTreeItem.vue +64 -0
- package/components/content/FileTreeRoot.vue +27 -0
- package/components/content/Hero.vue +154 -0
- package/components/content/HeroAlt.vue +116 -0
- package/components/content/Icon.vue +69 -0
- package/components/content/Kbd.vue +20 -0
- package/components/content/PmInstall.vue +35 -0
- package/components/content/PmRun.vue +31 -0
- package/components/content/PmX.vue +31 -0
- package/components/content/ProseA.vue +21 -0
- package/components/content/ProseBlockquote.vue +5 -0
- package/components/content/ProseCode.vue +121 -0
- package/components/content/ProseCodeInline.vue +24 -0
- package/components/content/ProseEm.vue +5 -0
- package/components/content/ProseH1.vue +27 -0
- package/components/content/ProseH2.vue +22 -0
- package/components/content/ProseH3.vue +21 -0
- package/components/content/ProseH4.vue +21 -0
- package/components/content/ProseH5.vue +21 -0
- package/components/content/ProseH6.vue +21 -0
- package/components/content/ProseHr.vue +3 -0
- package/components/content/ProseImg.vue +42 -0
- package/components/content/ProseLi.vue +5 -0
- package/components/content/ProseOl.vue +5 -0
- package/components/content/ProseP.vue +5 -0
- package/components/content/ProsePre.vue +56 -0
- package/components/content/ProseSection.vue +27 -0
- package/components/content/ProseStrong.vue +5 -0
- package/components/content/ProseTable.vue +7 -0
- package/components/content/ProseTbody.vue +5 -0
- package/components/content/ProseTd.vue +5 -0
- package/components/content/ProseTh.vue +5 -0
- package/components/content/ProseThead.vue +5 -0
- package/components/content/ProseTr.vue +5 -0
- package/components/content/ProseUl.vue +5 -0
- package/components/content/ReadMore.vue +41 -0
- package/components/content/Shortcut.vue +20 -0
- package/components/content/Stack.vue +17 -0
- package/components/content/Steps.vue +23 -0
- package/components/content/Tabs.vue +52 -0
- package/components/content/TabsInner.vue +263 -0
- package/components/content/TeamCard.vue +52 -0
- package/components/content/TeamCardGroup.vue +5 -0
- package/components/content/global/AlertEditor.vue +58 -0
- package/components/content/global/BadgeEditor.vue +56 -0
- package/components/content/global/BrEditor.vue +3 -0
- package/components/content/global/CardEditor.vue +142 -0
- package/components/content/global/CardGroupEditor.vue +50 -0
- package/components/content/global/CodeGroup.vue +13 -0
- package/components/content/global/CodeGroupEditor.vue +50 -0
- package/components/content/global/DivEditor.vue +22 -0
- package/components/content/global/FieldEditor.vue +38 -0
- package/components/content/global/FieldGroupEditor.vue +24 -0
- package/components/content/global/HeroEditor.vue +67 -0
- package/components/content/global/ProseSectionEditor.vue +180 -0
- package/components/content/global/ReadMoreEditor.vue +70 -0
- package/components/content/global/SectionEditor.vue +22 -0
- package/components/content/global/StackEditor.vue +35 -0
- package/components/content/global/StepsEditor.vue +55 -0
- package/components/content/global/Tabs._vue +97 -0
- package/components/content/global/TabsEditor.vue +38 -0
- package/components/layout/Aside.vue +83 -0
- package/components/layout/AsideTree.vue +25 -0
- package/components/layout/AsideTreeItem.vue +86 -0
- package/components/layout/AsideTreeItemButton.vue +32 -0
- package/components/layout/Banner.vue +77 -0
- package/components/layout/Breadcrumb.vue +34 -0
- package/components/layout/DocsFooter.vue +6 -0
- package/components/layout/EditLink.vue +23 -0
- package/components/layout/Footer.vue +80 -0
- package/components/layout/FooterItem.vue +50 -0
- package/components/layout/FooterSubmenuItem.vue +39 -0
- package/components/layout/Header/Logo.vue +30 -0
- package/components/layout/Header/MenuItem.vue +83 -0
- package/components/layout/Header/Nav.vue +112 -0
- package/components/layout/Header/NavMobile.vue +14 -0
- package/components/layout/Header/NavMobileItem.vue +79 -0
- package/components/layout/Header/SubmenuItem.vue +39 -0
- package/components/layout/Header.vue +160 -0
- package/components/layout/LangSwitcher.vue +90 -0
- package/components/layout/MobileNav.vue +44 -0
- package/components/layout/PrevNext.vue +24 -0
- package/components/layout/PrevNextButton.vue +50 -0
- package/components/layout/SearchButton.vue +46 -0
- package/components/layout/SearchDialog.vue +217 -0
- package/components/layout/Title.vue +98 -0
- package/components/layout/Toc.vue +99 -0
- package/components/layout/TocTree.vue +42 -0
- package/components/ui/accordion/Accordion.vue +19 -0
- package/components/ui/accordion/AccordionContent.vue +24 -0
- package/components/ui/accordion/AccordionItem.vue +24 -0
- package/components/ui/accordion/AccordionTrigger.vue +39 -0
- package/components/ui/accordion/index.ts +4 -0
- package/components/ui/alert/Alert.vue +19 -0
- package/components/ui/alert/AlertDescription.vue +14 -0
- package/components/ui/alert/AlertTitle.vue +14 -0
- package/components/ui/alert/index.ts +23 -0
- package/components/ui/avatar/Avatar.vue +25 -0
- package/components/ui/avatar/AvatarFallback.vue +11 -0
- package/components/ui/avatar/AvatarImage.vue +12 -0
- package/components/ui/avatar/index.ts +24 -0
- package/components/ui/badge/Badge.vue +17 -0
- package/components/ui/badge/index.ts +71 -0
- package/components/ui/breadcrumb/Breadcrumb.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbItem.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbLink.vue +23 -0
- package/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
- package/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
- package/components/ui/breadcrumb/index.ts +6 -0
- package/components/ui/button/Button.vue +29 -0
- package/components/ui/button/index.ts +35 -0
- package/components/ui/card/Card.vue +21 -0
- package/components/ui/card/CardContent.vue +14 -0
- package/components/ui/card/CardDescription.vue +14 -0
- package/components/ui/card/CardFooter.vue +14 -0
- package/components/ui/card/CardHeader.vue +14 -0
- package/components/ui/card/CardTitle.vue +18 -0
- package/components/ui/card/index.ts +6 -0
- package/components/ui/collapsible/Collapsible.vue +18 -0
- package/components/ui/collapsible/CollapsibleContent.vue +14 -0
- package/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
- package/components/ui/collapsible/index.ts +3 -0
- package/components/ui/command/Command.vue +89 -0
- package/components/ui/command/CommandEmpty.vue +30 -0
- package/components/ui/command/CommandGroup.vue +50 -0
- package/components/ui/command/CommandInput.vue +44 -0
- package/components/ui/command/CommandInputOnly.vue +50 -0
- package/components/ui/command/CommandItem.vue +79 -0
- package/components/ui/command/CommandList.vue +28 -0
- package/components/ui/command/CommandSeparator.vue +24 -0
- package/components/ui/command/index.ts +24 -0
- package/components/ui/dialog/Dialog.vue +14 -0
- package/components/ui/dialog/DialogClose.vue +11 -0
- package/components/ui/dialog/DialogContent.vue +52 -0
- package/components/ui/dialog/DialogDescription.vue +24 -0
- package/components/ui/dialog/DialogFooter.vue +19 -0
- package/components/ui/dialog/DialogHeader.vue +16 -0
- package/components/ui/dialog/DialogScrollContent.vue +61 -0
- package/components/ui/dialog/DialogTitle.vue +29 -0
- package/components/ui/dialog/DialogTrigger.vue +11 -0
- package/components/ui/dialog/index.ts +9 -0
- package/components/ui/input/Input.vue +27 -0
- package/components/ui/input/index.ts +1 -0
- package/components/ui/label/Label.vue +27 -0
- package/components/ui/label/index.ts +1 -0
- package/components/ui/navigation-menu/NavigationMenu.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuContent.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuIndicator.vue +24 -0
- package/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
- package/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
- package/components/ui/navigation-menu/NavigationMenuList.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuTrigger.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuViewport.vue +33 -0
- package/components/ui/navigation-menu/index.ts +14 -0
- package/components/ui/popover/Popover.vue +15 -0
- package/components/ui/popover/PopoverContent.vue +49 -0
- package/components/ui/popover/PopoverTrigger.vue +11 -0
- package/components/ui/popover/index.ts +4 -0
- package/components/ui/scroll-area/ScrollArea.vue +32 -0
- package/components/ui/scroll-area/ScrollBar.vue +41 -0
- package/components/ui/scroll-area/index.ts +2 -0
- package/components/ui/separator/Separator.vue +20 -0
- package/components/ui/separator/index.ts +1 -0
- package/components/ui/sheet/Sheet.vue +14 -0
- package/components/ui/sheet/SheetClose.vue +11 -0
- package/components/ui/sheet/SheetContent.vue +58 -0
- package/components/ui/sheet/SheetDescription.vue +22 -0
- package/components/ui/sheet/SheetFooter.vue +19 -0
- package/components/ui/sheet/SheetHeader.vue +16 -0
- package/components/ui/sheet/SheetTitle.vue +22 -0
- package/components/ui/sheet/SheetTrigger.vue +11 -0
- package/components/ui/sheet/index.ts +31 -0
- package/components/ui/slider/Slider.vue +36 -0
- package/components/ui/slider/index.ts +1 -0
- package/components/ui/tabs/Tabs.vue +15 -0
- package/components/ui/tabs/TabsContent.vue +22 -0
- package/components/ui/tabs/TabsList.vue +25 -0
- package/components/ui/tabs/TabsTrigger.vue +27 -0
- package/components/ui/tabs/index.ts +4 -0
- package/components/ui/textarea/Textarea.vue +27 -0
- package/components/ui/textarea/index.ts +1 -0
- package/components/ui/toast/Toast.vue +28 -0
- package/components/ui/toast/ToastAction.vue +22 -0
- package/components/ui/toast/ToastClose.vue +27 -0
- package/components/ui/toast/ToastDescription.vue +22 -0
- package/components/ui/toast/ToastProvider.vue +11 -0
- package/components/ui/toast/ToastTitle.vue +22 -0
- package/components/ui/toast/ToastViewport.vue +20 -0
- package/components/ui/toast/Toaster.vue +34 -0
- package/components/ui/toast/index.ts +38 -0
- package/components/ui/toast/use-toast.ts +165 -0
- package/components.json +18 -0
- package/composables/useBreadcrumb.ts +47 -0
- package/composables/useCollapsedMap.ts +3 -0
- package/composables/useConfig.ts +227 -0
- package/composables/useEditLink.ts +27 -0
- package/composables/useI18nDocs.ts +114 -0
- package/composables/useMdcMenu.ts +204 -0
- package/composables/usePm.ts +58 -0
- package/composables/useScrollspy.ts +51 -0
- package/composables/useThemes.ts +46 -0
- package/composables/useToast.ts +1 -0
- package/content/index.md +45 -0
- package/eslint.config.js +3 -0
- package/i18n/i18n.config.ts +414 -0
- package/index.d.ts +610 -0
- package/layouts/blank.vue +5 -0
- package/layouts/default.vue +9 -0
- package/layouts/editorial.vue +83 -0
- package/lib/registry/themes.ts +636 -0
- package/lib/uno-preset.ts +143 -0
- package/memory-bank/activeContext.md +17 -0
- package/memory-bank/productContext.md +21 -0
- package/memory-bank/progress.md +16 -0
- package/memory-bank/projectbrief.md +20 -0
- package/memory-bank/systemPatterns.md +25 -0
- package/memory-bank/techContext.md +29 -0
- package/modules/inject-css.ts +40 -0
- package/nuxt.config.ts +124 -0
- package/package.json +71 -0
- package/pages/[...slug].vue +109 -0
- package/pages/admin/[...slug].vue +145 -0
- package/pages/index.vue +24 -0
- package/plugins/injectCssHmr.ts +26 -0
- package/plugins/wordup.ts +130 -0
- package/public/content-doc.json +792 -0
- package/public/iconesjs.svg +4 -0
- package/scripts/buildContentDoc-cli.ts +8 -0
- package/scripts/buildContentDoc.ts +165 -0
- package/tailwind.config.js +1 -0
- package/tsconfig.json +3 -0
- package/uno.config.mjs +58 -0
- package/utils/index.ts +12 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavItem } from '@nuxt/content'
|
|
3
|
+
import { useUnpress } from '#imports'
|
|
4
|
+
|
|
5
|
+
const { client, mountCms, login } = useUnpress()
|
|
6
|
+
const config = useConfig()
|
|
7
|
+
|
|
8
|
+
const isDev = import.meta.dev
|
|
9
|
+
const isLoggedIn = computed(() => !!client.value)
|
|
10
|
+
|
|
11
|
+
const path = 'content-doc.json'
|
|
12
|
+
|
|
13
|
+
// const { data: tree, status, error, refresh, clear } = await useAsyncData<NavItem[]>(
|
|
14
|
+
const { data: tree } = await useAsyncData<NavItem[]>(
|
|
15
|
+
'admin-docs',
|
|
16
|
+
() => $fetch(`/${path}`), {
|
|
17
|
+
transform: (data) => {
|
|
18
|
+
return data.map((item: NavItem) => ({
|
|
19
|
+
...item,
|
|
20
|
+
'_path': `/admin/${item._path}`,
|
|
21
|
+
'navigation.redirect': item['navigation.redirect'] ? '/admin' + item['navigation.redirect'] : undefined,
|
|
22
|
+
'children': item.children?.map((child: NavItem) => ({
|
|
23
|
+
...child,
|
|
24
|
+
'_path': `/admin/${child._path}`,
|
|
25
|
+
'navigation.redirect': child['navigation.redirect'] ? '/admin' + child['navigation.redirect'] : undefined,
|
|
26
|
+
'children': child.children?.map((child2: NavItem) => ({
|
|
27
|
+
...child2,
|
|
28
|
+
'_path': `/admin/${child2._path}`,
|
|
29
|
+
'navigation.redirect': child2['navigation.redirect'] ? '/admin' + child2['navigation.redirect'] : undefined,
|
|
30
|
+
})),
|
|
31
|
+
})),
|
|
32
|
+
}))
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const { slug } = useRoute().params
|
|
38
|
+
|
|
39
|
+
if (isLoggedIn.value && slug?.length === 0 && tree.value) {
|
|
40
|
+
if (tree.value[0]['navigation.redirect']) {
|
|
41
|
+
await navigateTo(tree.value[0]['navigation.redirect'])
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
await navigateTo(tree.value[0]._path)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const page = computed(() => {
|
|
49
|
+
if (slug.length > 2) {
|
|
50
|
+
const level0 = tree.value?.find(item => item._path === `/admin/${slug[0]}`)
|
|
51
|
+
const level1 = level0?.children?.find(item => item._path === `/admin/${slug[0]}/${slug[1]}`)
|
|
52
|
+
return level1?.children?.find(item => item._path === `/admin/${slug[0]}/${slug[1]}/${slug[2]}`)
|
|
53
|
+
}
|
|
54
|
+
else if (slug.length > 1) {
|
|
55
|
+
const level0 = tree.value?.find(item => item._path === `/admin/${slug[0]}`)
|
|
56
|
+
return level0?.children?.find(item => item._path === `/admin/${slug[0]}/${slug[1]}`)
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const page = tree.value?.find(item => item._path === `/admin/${slug[0]}`)
|
|
60
|
+
|
|
61
|
+
if (!page?.['navigation.redirect'] && !page?.content && page?.children?.length) {
|
|
62
|
+
return page.children.find(item => item._path === `/admin/${slug[0]}/index`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return page
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
watch(page, async (newVal) => {
|
|
70
|
+
if (newVal?.['navigation.redirect']) {
|
|
71
|
+
await navigateTo(newVal['navigation.redirect'])
|
|
72
|
+
}
|
|
73
|
+
}, { immediate: true })
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<NuxtLayout>
|
|
78
|
+
<div class="h-full">
|
|
79
|
+
<div
|
|
80
|
+
v-if="isLoggedIn"
|
|
81
|
+
class="flex-1 items-start px-4 md:grid md:gap-6 md:px-8 lg:gap-10"
|
|
82
|
+
:class="[
|
|
83
|
+
config.main.padded && 'container',
|
|
84
|
+
'md:grid-cols-[220px_minmax(0,1fr)] lg:grid-cols-[240px_minmax(0,1fr)]',
|
|
85
|
+
]"
|
|
86
|
+
>
|
|
87
|
+
<aside
|
|
88
|
+
class="sticky top-[162px] z-30 w-full shrink-0 overflow-y-auto md:sticky md:top-[90px] md:block"
|
|
89
|
+
>
|
|
90
|
+
<LayoutAside
|
|
91
|
+
v-if="tree"
|
|
92
|
+
:level="1"
|
|
93
|
+
:navigation="tree"
|
|
94
|
+
:is-mobile="false"
|
|
95
|
+
/>
|
|
96
|
+
</aside>
|
|
97
|
+
|
|
98
|
+
<main
|
|
99
|
+
class="relative container"
|
|
100
|
+
:class="[
|
|
101
|
+
config.toc.enable,
|
|
102
|
+
'lg:grid lg:grid-cols-[1fr_220px] lg:gap-14 lg:py-8',
|
|
103
|
+
]"
|
|
104
|
+
>
|
|
105
|
+
<div
|
|
106
|
+
v-if="page"
|
|
107
|
+
class="mx-auto w-full min-w-0"
|
|
108
|
+
>
|
|
109
|
+
<div class="p-1 mb-4 rounded border border-red-500">
|
|
110
|
+
<LayoutBreadcrumb />
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<LayoutTitle
|
|
114
|
+
v-if="config.main?.showTitle && (page.showTitle ?? true)"
|
|
115
|
+
:title="page?.title"
|
|
116
|
+
:description="page?.description"
|
|
117
|
+
:badges="page?.badges"
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
<MDC
|
|
121
|
+
v-if="page.content"
|
|
122
|
+
:value="page.content"
|
|
123
|
+
tag="article"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</main>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div
|
|
130
|
+
v-else
|
|
131
|
+
class="col-span-3 mt-[20vh] flex items-center justify-center"
|
|
132
|
+
>
|
|
133
|
+
<div class="flex items-center justify-center gap-4">
|
|
134
|
+
<h3 class="scroll-m-20 py-3 text-2xl font-semibold">
|
|
135
|
+
Open administration
|
|
136
|
+
</h3>
|
|
137
|
+
<Icon name="lucide:arrow-right" />
|
|
138
|
+
<UiButton @click="isDev ? mountCms() : login()">
|
|
139
|
+
Connect & Open
|
|
140
|
+
</Uibutton>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</NuxtLayout>
|
|
145
|
+
</template>
|
package/pages/index.vue
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NuxtLayout :class="page.header.position === 'over' && 'header-over'">
|
|
3
|
+
<ContentCms
|
|
4
|
+
:key="page._id"
|
|
5
|
+
:value="page"
|
|
6
|
+
class="content-grid"
|
|
7
|
+
/>
|
|
8
|
+
<!-- <ContentRenderer :key="page._id" :value="page" class="content-grid" /> -->
|
|
9
|
+
</NuxtLayout>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
const { page } = useContent()
|
|
14
|
+
const config = useConfig()
|
|
15
|
+
|
|
16
|
+
useSeoMeta({
|
|
17
|
+
title: `${page.value?.title ?? '404'} - ${config.value.site.name}`,
|
|
18
|
+
ogTitle: page.value?.title,
|
|
19
|
+
description: page.value?.description,
|
|
20
|
+
ogDescription: page.value?.description,
|
|
21
|
+
ogImage: config.value.site.ogImage,
|
|
22
|
+
twitterCard: 'summary_large_image',
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// plugins/hmrListener.plugin.js
|
|
2
|
+
|
|
3
|
+
export default defineNuxtPlugin(() => { // nuxtApp
|
|
4
|
+
// Check if HMR is enabled and available
|
|
5
|
+
// if (import.meta.hot) {
|
|
6
|
+
// // Listen for specific module updates
|
|
7
|
+
// import.meta.hot.on('vite:beforeUpdate', (payload) => {
|
|
8
|
+
// console.log('Vite before update:', payload);
|
|
9
|
+
// });
|
|
10
|
+
|
|
11
|
+
// import.meta.hot.on('vite:afterUpdate', (payload) => {
|
|
12
|
+
// console.log('Vite after update:', payload);
|
|
13
|
+
// });
|
|
14
|
+
|
|
15
|
+
// import.meta.hot.on('vite:error', (payload) => {
|
|
16
|
+
// console.error('Vite error during update:', payload);
|
|
17
|
+
// });
|
|
18
|
+
|
|
19
|
+
// // Listen for any HMR event
|
|
20
|
+
// import.meta.hot.on('*', (event, payload) => {
|
|
21
|
+
// console.log(`Received HMR event: ${event}`, payload);
|
|
22
|
+
// });
|
|
23
|
+
// } else {
|
|
24
|
+
// console.warn('HMR is not enabled or not available.');
|
|
25
|
+
// }
|
|
26
|
+
})
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export default defineNuxtPlugin(() => {
|
|
2
|
+
// export default defineNuxtPlugin((nuxtApp) => {
|
|
3
|
+
// nuxtApp.hook('mdc-editor:config', ({ config, editor }: { config: any, editor: any }) => {
|
|
4
|
+
// config.components.push({
|
|
5
|
+
// displayName: 'Callout',
|
|
6
|
+
// description: 'Insert a customizable callout',
|
|
7
|
+
// group: 'Docs Components',
|
|
8
|
+
// icon: 'i-lucide-megaphone',
|
|
9
|
+
// previewHTML: `
|
|
10
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
11
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
12
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
13
|
+
// `,
|
|
14
|
+
// handleMenu: true,
|
|
15
|
+
// slashMenu: true,
|
|
16
|
+
// transformable: true,
|
|
17
|
+
// transform() {
|
|
18
|
+
// return { type: 'containerComponent', attrs: { componentName: 'callout' } }
|
|
19
|
+
// },
|
|
20
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
21
|
+
// name: 'callout',
|
|
22
|
+
// }),
|
|
23
|
+
// })
|
|
24
|
+
|
|
25
|
+
// config.components.push({
|
|
26
|
+
// displayName: 'Read More',
|
|
27
|
+
// description: 'Insert a "Read More" block',
|
|
28
|
+
// group: 'Docs Components',
|
|
29
|
+
// icon: 'i-lucide-bookmark',
|
|
30
|
+
// previewHTML: `
|
|
31
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
32
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
33
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
34
|
+
// `,
|
|
35
|
+
// handleMenu: true,
|
|
36
|
+
// slashMenu: true,
|
|
37
|
+
// transformable: true,
|
|
38
|
+
// transform() {
|
|
39
|
+
// return { type: 'containerComponent', attrs: { componentName: 'read-more' } }
|
|
40
|
+
// },
|
|
41
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
42
|
+
// name: 'read-more',
|
|
43
|
+
// }),
|
|
44
|
+
// })
|
|
45
|
+
|
|
46
|
+
// config.components.push({
|
|
47
|
+
// displayName: 'Steps',
|
|
48
|
+
// description: 'Insert a steps',
|
|
49
|
+
// group: 'Docs Components',
|
|
50
|
+
// icon: 'i-lucide-arrow-down-0-1',
|
|
51
|
+
// previewHTML: `
|
|
52
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
53
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
54
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
55
|
+
// `,
|
|
56
|
+
// handleMenu: true,
|
|
57
|
+
// slashMenu: true,
|
|
58
|
+
// transformable: true,
|
|
59
|
+
// transform() {
|
|
60
|
+
// return { type: 'containerComponent', attrs: { componentName: 'steps' } }
|
|
61
|
+
// },
|
|
62
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
63
|
+
// name: 'steps',
|
|
64
|
+
// }),
|
|
65
|
+
// })
|
|
66
|
+
|
|
67
|
+
// config.components.push({
|
|
68
|
+
// displayName: 'Card',
|
|
69
|
+
// description: 'Insert a card',
|
|
70
|
+
// group: 'Docs Components',
|
|
71
|
+
// icon: 'i-lucide-square',
|
|
72
|
+
// previewHTML: `
|
|
73
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
74
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
75
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
76
|
+
// `,
|
|
77
|
+
// handleMenu: true,
|
|
78
|
+
// slashMenu: true,
|
|
79
|
+
// transformable: true,
|
|
80
|
+
// transform() {
|
|
81
|
+
// return { type: 'containerComponent', attrs: { componentName: 'card' } }
|
|
82
|
+
// },
|
|
83
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
84
|
+
// name: 'card',
|
|
85
|
+
// }),
|
|
86
|
+
// })
|
|
87
|
+
|
|
88
|
+
// config.components.push({
|
|
89
|
+
// displayName: 'Card Group',
|
|
90
|
+
// description: 'Insert a card group',
|
|
91
|
+
// group: 'Page Components',
|
|
92
|
+
// icon: 'i-lucide-layout-grid',
|
|
93
|
+
// previewHTML: `
|
|
94
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
95
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
96
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
97
|
+
// `,
|
|
98
|
+
// handleMenu: true,
|
|
99
|
+
// slashMenu: true,
|
|
100
|
+
// transformable: true,
|
|
101
|
+
// transform() {
|
|
102
|
+
// return { type: 'containerComponent', attrs: { componentName: 'card-group' } }
|
|
103
|
+
// },
|
|
104
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
105
|
+
// name: 'card-group',
|
|
106
|
+
// }),
|
|
107
|
+
// })
|
|
108
|
+
|
|
109
|
+
// config.components.push({
|
|
110
|
+
// displayName: 'Div',
|
|
111
|
+
// description: 'Insert a div',
|
|
112
|
+
// group: 'Page Components',
|
|
113
|
+
// icon: 'i-lucide-code',
|
|
114
|
+
// previewHTML: `
|
|
115
|
+
// <p class="text-skeleton pt2 px2.5">x xxx xxxx xxx xxx xx x xxx</p>
|
|
116
|
+
// <p class="text-skeleton bg-teal-500 px2.5 py2">x xx xxx xx xxxx xx xx</p>
|
|
117
|
+
// <p class="text-skeleton px2.5">xx x xxx xxx x xx xxx</p>
|
|
118
|
+
// `,
|
|
119
|
+
// handleMenu: true,
|
|
120
|
+
// slashMenu: true,
|
|
121
|
+
// transformable: true,
|
|
122
|
+
// transform() {
|
|
123
|
+
// return { type: 'containerComponent', attrs: { componentName: 'div' } }
|
|
124
|
+
// },
|
|
125
|
+
// onSelect: () => editor.commands.insertContainerComponent({
|
|
126
|
+
// name: 'div',
|
|
127
|
+
// }),
|
|
128
|
+
// })
|
|
129
|
+
// })
|
|
130
|
+
})
|