From 9d13e9aac2150ceab5e0973860c9436a1f3946a7 Mon Sep 17 00:00:00 2001 From: li-chx Date: Sun, 15 Nov 2026 22:05:13 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=BF=81=E7=A7=BB=20Markdown=20?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=B9=B6=E6=B7=BB=E5=8A=A0=20Mermaid=20?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=92=8C=E6=96=87=E7=AB=A0=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MermaidDiagram.client.vue | 171 +++++++++++++++ components/ReadonlyMdEditor.vue | 79 ------- .../theme/classic/markdown/ProseCode.vue | 9 + .../theme/classic/markdown/ProsePre.vue | 18 ++ composables/useNavbarHeight.ts | 9 + content | 2 +- layouts/UserLayout.vue | 11 +- nuxt.config.ts | 18 +- package.json | 1 - .../[articleID]/components/ArticleContent.vue | 28 +++ .../[articleID]/components/ArticleToc.vue | 59 +++++ .../[articleID]/components/TocList.vue | 207 ++++++++++++++++++ pages/index/article/[articleID]/index.vue | 10 +- pages/index/components/SimpleCard.vue | 14 +- 14 files changed, 535 insertions(+), 101 deletions(-) create mode 100644 components/MermaidDiagram.client.vue delete mode 100644 components/ReadonlyMdEditor.vue create mode 100644 components/theme/classic/markdown/ProseCode.vue create mode 100644 components/theme/classic/markdown/ProsePre.vue create mode 100644 composables/useNavbarHeight.ts create mode 100644 pages/index/article/[articleID]/components/ArticleContent.vue create mode 100644 pages/index/article/[articleID]/components/ArticleToc.vue create mode 100644 pages/index/article/[articleID]/components/TocList.vue diff --git a/components/MermaidDiagram.client.vue b/components/MermaidDiagram.client.vue new file mode 100644 index 0000000..d65e1cc --- /dev/null +++ b/components/MermaidDiagram.client.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/components/ReadonlyMdEditor.vue b/components/ReadonlyMdEditor.vue deleted file mode 100644 index f107bea..0000000 --- a/components/ReadonlyMdEditor.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/components/theme/classic/markdown/ProseCode.vue b/components/theme/classic/markdown/ProseCode.vue new file mode 100644 index 0000000..001dca0 --- /dev/null +++ b/components/theme/classic/markdown/ProseCode.vue @@ -0,0 +1,9 @@ + diff --git a/components/theme/classic/markdown/ProsePre.vue b/components/theme/classic/markdown/ProsePre.vue new file mode 100644 index 0000000..370a260 --- /dev/null +++ b/components/theme/classic/markdown/ProsePre.vue @@ -0,0 +1,18 @@ + + + diff --git a/composables/useNavbarHeight.ts b/composables/useNavbarHeight.ts new file mode 100644 index 0000000..f5abd3e --- /dev/null +++ b/composables/useNavbarHeight.ts @@ -0,0 +1,9 @@ +const KEY: InjectionKey> = Symbol('navbarHeight'); + +export function provideNavbarHeight(h: Ref) { + provide(KEY, h); +} + +export function injectNavbarHeight(): Ref { + return inject(KEY, ref(48)); +} diff --git a/content b/content index 2865b12..78c4554 160000 --- a/content +++ b/content @@ -1 +1 @@ -Subproject commit 2865b12ed961e0d4d066e11c04052bd710cf24e2 +Subproject commit 78c45544b34b3584a42068078effd7c817a731f8 diff --git a/layouts/UserLayout.vue b/layouts/UserLayout.vue index 21ed9f8..63c941c 100644 --- a/layouts/UserLayout.vue +++ b/layouts/UserLayout.vue @@ -1,6 +1,7 @@