Skip to content

Commit f0f7182

Browse files
committed
Switched to rehype-mermaid
1 parent 26b63cf commit f0f7182

File tree

10 files changed

+696
-33
lines changed

10 files changed

+696
-33
lines changed

.github/workflows/deploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Checkout your repository using git
2222
uses: actions/checkout@v4
23+
- name: Install Playwright Browsers
24+
run: npx playwright install --with-deps
2325
- name: Install, build, and upload your site
2426
uses: withastro/action@v2
2527
# with:

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,6 @@ All commands are run from the root of the project, from a terminal:
240240
- automatically generated sidebar links
241241
- improved RSS and search metadata
242242
- 5.0.0: Major changes:
243-
- Upgrade to Astro 5.X
243+
- Upgrade to Astro 5.X
244+
- Changed Leaflet CSS to always use latest
245+
- Migrate from bespoke mermaid implementation to rehype-mermaid

astro.config.mjs

+10-12
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,33 @@ import robotsTxt from 'astro-robots-txt';
77
import remarkMath from 'remark-math';
88
import remarkEmoji from 'remark-emoji';
99
import rehypeKatex from 'rehype-katex';
10+
import rehypeMermaid from 'rehype-mermaid';
1011
import remarkPlantUML from '@akebifiky/remark-simple-plantuml';
1112
import { remarkReadingTime } from './remark-plugins/remark-reading-time.mjs';
1213
import { remarkDiagram } from './remark-plugins/remark-diagram.mjs';
1314
import icon from "astro-icon";
1415

1516
import markdoc from "@astrojs/markdoc";
1617

18+
import expressiveCode from 'astro-expressive-code';
19+
1720
// https://astro.build/config
1821
export default defineConfig({
1922
vite: {
2023
plugins: [tailwindcss()],
2124
ssr: {
2225
external: ['svgo'],
23-
noExternal: ['swiper', 'leaflet']
24-
}
26+
noExternal: ['swiper']
27+
},
28+
optimizeDeps: { include: ['leaflet'] }
2529
},
2630
site: 'https://hellotham.github.io',
2731
base: '/hello-astro/',
28-
integrations: [icon(), sitemap(), mdx(), alpinejs(), robotsTxt(), markdoc()],
32+
integrations: [icon(), sitemap(), alpinejs(), robotsTxt(), markdoc(), expressiveCode(), mdx()],
2933
markdown: {
3034
extendDefaultPlugins: true,
3135
remarkPlugins: [remarkReadingTime, remarkMath, remarkPlantUML, remarkDiagram, remarkEmoji],
32-
rehypePlugins: [rehypeKatex],
33-
shikiConfig: {
34-
theme: 'github-light',
35-
langs: [],
36-
// Enable word wrap to prevent horizontal scrolling
37-
wrap: true
38-
},
36+
rehypePlugins: [rehypeMermaid, rehypeKatex]
3937
},
40-
scopedStyleStrategy: "where",
41-
});
38+
scopedStyleStrategy: 'where'
39+
})

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
"@iconify-json/bi": "^1.2.2",
5656
"@iconify-json/heroicons": "^1.2.2",
5757
"@tailwindcss/vite": "^4.0.6",
58+
"astro-expressive-code": "^0.40.2",
59+
"astro-geo-map": "^2.0.0",
5860
"astro-icon": "^1.1.5",
5961
"astro-seo": "^0.8.4",
6062
"hero-patterns": "^2.1.0",
@@ -64,6 +66,8 @@
6466
"mermaid": "^11.4.1",
6567
"photoswipe": "^5.4.4",
6668
"photoswipe-dynamic-caption-plugin": "^1.2.7",
69+
"playwright": "^1.50.1",
70+
"rehype-mermaid": "^3.0.0",
6771
"swiper": "^11.2.4",
6872
"tailwindcss": "^4.0.6"
6973
},

0 commit comments

Comments
 (0)