From 3c5d4bc0be8a67fbc124750c0b55b7d7a919dc48 Mon Sep 17 00:00:00 2001 From: estel <690930@qq.com> Date: Thu, 24 Jul 2025 21:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.config.ts | 7 ++ app/app.vue | 4 +- app/components/AppHeader.vue | 7 -- app/components/AppSidebar.vue | 116 ++++++++++++++++++++++++++++++++++ app/layouts/default.vue | 40 ++++++++++++ app/pages/[...slug].vue | 103 ++++++++++++++++++++---------- 6 files changed, 233 insertions(+), 44 deletions(-) create mode 100644 app/components/AppSidebar.vue create mode 100644 app/layouts/default.vue diff --git a/app/app.config.ts b/app/app.config.ts index 657e3c8..4a9aa2c 100644 --- a/app/app.config.ts +++ b/app/app.config.ts @@ -80,5 +80,12 @@ export default defineAppConfig({ target: '_blank' }] } + }, + github: { + url: 'https://github.com/estel-li/estel_docs', + owner: 'estel-li', + name: 'estel_docs', + branch: 'main', + rootDir: '' } }) diff --git a/app/app.vue b/app/app.vue index be86519..26f1a5b 100644 --- a/app/app.vue +++ b/app/app.vue @@ -31,7 +31,7 @@ provide('navigation', navigation) - + @@ -39,7 +39,7 @@ provide('navigation', navigation) - + - + + diff --git a/app/layouts/default.vue b/app/layouts/default.vue new file mode 100644 index 0000000..5d009e1 --- /dev/null +++ b/app/layouts/default.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/app/pages/[...slug].vue b/app/pages/[...slug].vue index 019289d..a21094a 100644 --- a/app/pages/[...slug].vue +++ b/app/pages/[...slug].vue @@ -2,12 +2,12 @@ import type { ContentNavigationItem } from '@nuxt/content' import { findPageHeadline } from '#ui-pro/utils/content' -definePageMeta({ - layout: 'docs' -}) +// definePageMeta({ +// layout: 'docs' +// }) const route = useRoute() -const { toc } = useAppConfig() +const appConfig = useAppConfig() const navigation = inject>('navigation') const { data: page } = await useAsyncData(route.path, () => queryCollection('docs').path(route.path).first()) @@ -37,18 +37,33 @@ defineOgImageComponent('Docs', { headline: headline.value }) +const editLink = computed(() => { + if (!appConfig.github) { + return + } + + return [ + appConfig.github.url, + 'edit', + appConfig.github.branch, + appConfig.github.rootDir, + 'content', + `${page.value?.stem}.${page.value?.extension}`, + ].filter(Boolean).join('/') +}) + const links = computed(() => { const links = [] - if (toc?.bottom?.edit) { + if (appConfig.toc?.bottom?.edit) { links.push({ icon: 'i-lucide-external-link', label: 'Edit this page', - to: `${toc.bottom.edit}/${page?.value?.stem}.${page?.value?.extension}`, + to: `${appConfig.toc.bottom.edit}/${page?.value?.stem}.${page?.value?.extension}`, target: '_blank' }) } - return [...links, ...(toc?.bottom?.links || [])].filter(Boolean) + return [...links, ...(appConfig.toc?.bottom?.links || [])].filter(Boolean) }) @@ -57,46 +72,64 @@ const links = computed(() => { + :ui="{ + wrapper: 'flex-row items-center flex-wrap justify-between', + }" + > + + - - - + + +
+ + Edit this page + + or + + Report an issue + +
+
-