@@ -57,6 +57,33 @@ const formattedDate = date.toLocaleDateString('en-US', { month: 'long', day: 'nu
5757 </nav >
5858 )}
5959 </article >
60+
61+ <script >
62+ // Load Mermaid.js only on pages that have mermaid diagram blocks
63+ if (document.querySelector('.mermaid')) {
64+ import('https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs')
65+ .then(({ default: mermaid }) => {
66+ mermaid.initialize({
67+ startOnLoad: false,
68+ theme: 'dark',
69+ themeVariables: {
70+ darkMode: true,
71+ background: '#0f172a',
72+ primaryColor: '#1e293b',
73+ primaryTextColor: '#e2e8f0',
74+ primaryBorderColor: '#22d3ee',
75+ lineColor: '#22d3ee',
76+ secondaryColor: '#0f172a',
77+ tertiaryColor: '#1e293b',
78+ noteBkgColor: '#1e293b',
79+ noteTextColor: '#94a3b8',
80+ fontFamily: 'ui-monospace, monospace',
81+ },
82+ });
83+ mermaid.run({ nodes: document.querySelectorAll('.mermaid') });
84+ });
85+ }
86+ </script >
6087</Base >
6188
6289<style >
@@ -151,6 +178,20 @@ const formattedDate = date.toLocaleDateString('en-US', { month: 'long', day: 'nu
151178 font-size: inherit;
152179 color: var(--text-primary);
153180 }
181+ .article-body :global(pre.mermaid) {
182+ background: var(--code-bg);
183+ border: 1px solid rgba(34, 211, 238, 0.12);
184+ border-radius: 6px;
185+ padding: 20px;
186+ margin: 20px 0;
187+ overflow-x: auto;
188+ display: flex;
189+ justify-content: center;
190+ }
191+ .article-body :global(pre.mermaid svg) {
192+ max-width: 100%;
193+ height: auto;
194+ }
154195 .article-body :global(ul),
155196 .article-body :global(ol) {
156197 padding-left: 24px;
0 commit comments