Commit dc6bf56
修复代码语法高亮配置 - 添加Go语言支持
问题根因:
- 之前的配置只设置了 theme,但没有设置 langs 列表
- 导致 Nuxt Content 配置合并时覆盖了 Docus 的 highlight 配置
- Go 语言不在支持的语言列表中,Shiki 无法识别,回退到纯文本模式
修复方案:
在 nuxt.config.ts 中同时配置 langs 和 theme:
- langs: 包含 go, bash, js, ts, python, java 等语言
- theme: material-theme-lighter (亮色) / material-theme-palenight (暗黑)
验证:
- ✅ Go 代码块显示正确的语法高亮
- ✅ 关键字、字符串、注释有不同颜色
- ✅ 亮色和暗黑模式都正常工作
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 260958f commit dc6bf56
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
23 | 49 | | |
24 | 50 | | |
0 commit comments