mirror of
https://github.com/andwati/andwati.com.git
synced 2026-11-24 01:18:47 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user