Swap shiki for highlight.js's core build for syntax highlighting

Shiki pulls in a WASM oniguruma engine and bundled theme/grammar JSON
for two full themes; highlight.js's core build plus only the 11
languages content actually uses is much thinner for the same job here.
Token colors now come straight from the design tokens (--accent,
--text-muted, ...) instead of shiki's dual-theme CSS vars, so they
already switch with the site's theme with no extra [data-theme] rules.
This commit is contained in:
2026-09-01 09:20:12 +03:00
parent 74a7f80b29
commit 27e53993d6
5 changed files with 110 additions and 60 deletions
+7 -4
View File
@@ -117,10 +117,13 @@ approved plan for full rationale on each decision referenced below.
- [x] RSS/JSON feeds — `/rss.xml`, `/feed.json`
- [x] Sitemap + robots.txt — `@astrojs/sitemap`, static `public/robots.txt`
- [x] Code block syntax highlighting — `toml-content-loader.ts` renders
fenced code blocks through shiki (`github-light`/`github-dark`,
`defaultColor: false` so only per-token colors are set and our own
`pre` background/border/padding still apply), switched by the same
`[data-theme]`/`prefers-color-scheme` pattern as `tokens.css`
fenced code blocks through `highlight.js`'s core build with only the
11 languages content actually uses registered (no bundled-theme/WASM
grammar weight like shiki, which was tried first and swapped out for
this lighter option); `.hljs-*` token classes in `global.css` are
colored from the existing design tokens (`--accent`, `--text-muted`,
...), so they already switch with the site's theme with no extra
`[data-theme]` rules needed
## Search & comments