From 7dde0eb75176385b8b14a1a6f44293fed5702882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=81=E4=BD=B3=E6=9E=97?= Date: Sat, 17 Oct 2026 18:50:48 +0000 Subject: [PATCH] feat: add expandable Mermaid diagram viewer --- src/components/DiagramViewer.astro | 148 +++++++++++++++++++++++++++++ src/pages/blog/[slug].astro | 16 +++- src/styles/markdown.css | 24 ++++- 3 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 src/components/DiagramViewer.astro diff --git a/src/components/DiagramViewer.astro b/src/components/DiagramViewer.astro new file mode 100644 index 0000000..084882a --- /dev/null +++ b/src/components/DiagramViewer.astro @@ -0,0 +1,148 @@ + +
+
+

Diagram

+
+ + 100% + + + + +
+
+

Zoom in for details. Scroll to explore. Press Esc to close.

+
+ Expanded article diagram +
+
+
+ + + + diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro index bf7302b..8ac0039 100644 --- a/src/pages/blog/[slug].astro +++ b/src/pages/blog/[slug].astro @@ -1,6 +1,7 @@ --- import BaseLayout from "../../layouts/BaseLayout.astro"; import TableOfContents from "../../components/TableOfContents"; +import DiagramViewer from "../../components/DiagramViewer.astro"; import PostTagStrip from "../../components/PostTagStrip"; import { getPosts } from "../../utils/posts"; import { render } from "astro:content"; @@ -101,6 +102,7 @@ const isoDate = +