Skip to content

Commit a5e20ce

Browse files
committed
feat: vitepress mermaid plugin 추가
1 parent 5e570aa commit a5e20ce

4 files changed

Lines changed: 880 additions & 638 deletions

File tree

.vitepress/config.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import markdownItKatex from "markdown-it-katex";
77
import { createAutoGeneratePostsPlugin } from "./plugins/posts";
88
import { createImageOptimizerPlugin } from "./plugins/image-optimizer";
99
import { markdownPicturePlugin } from "./plugins/markdown-picture";
10+
import { withMermaid } from "vitepress-plugin-mermaid";
1011

1112
const isProduction = process.env.NODE_ENV === "production";
1213

1314
const GOOGLE_ANALYTICS_ID = "G-3XM039P5E6";
1415
const NAVER_SITE_VERIFICATION_CODE = "db7f3601aa486190aa58c3e09dcd7f35a784543e";
1516

1617
// https://vitepress.dev/reference/site-config
17-
export default defineConfig({
18+
export default withMermaid(defineConfig({
1819
lang: "ko-KR",
1920
title: "🦷 ToothlessDev",
2021
description: "A VitePress Site",
@@ -101,4 +102,4 @@ export default defineConfig({
101102
},
102103
],
103104
],
104-
});
105+
}));

.vitepress/theme/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import DefaultTheme from "vitepress/theme";
55
import Giscus from "@giscus/vue";
66
import PostCardList from "@/components/PostCardList/PostCardList.vue";
77
import PostLayout from "@/components/PostLayout/PostLayout.vue";
8+
import { MermaidPlugin } from "vitepress-plugin-mermaid";
89
import "./style.css";
910

1011
export default {
@@ -13,5 +14,6 @@ export default {
1314
enhanceApp({ app, router, siteData }) {
1415
app.component("PostCardList", PostCardList);
1516
app.component("Giscus", Giscus);
17+
app.use(MermaidPlugin);
1618
},
1719
} satisfies Theme;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"dependencies": {
1818
"@giscus/vue": "^3.1.1",
1919
"katex": "^0.16.25",
20-
"markdown-it-katex": "^2.0.3"
20+
"markdown-it-katex": "^2.0.3",
21+
"mermaid": "^11.14.0",
22+
"vitepress-plugin-mermaid": "^2.0.17"
2123
},
2224
"version": "0.0.0",
2325
"packageManager": "yarn@1.22.22"

0 commit comments

Comments
 (0)