我正在尝试将语法荧光笔与@nuxt/content和Shiki一起使用。
在我的nuxt.config.js
项目文件中安装 shiki 包后。
import shiki from 'shiki'
...
export default {
modules: ['@nuxt/content'],
content: {
markdown: {
async highlighter() {
const highlighter = await shiki.getHighlighter({
theme: 'nord'
})
return (rawCode, lang) => {
return highlighter.codeToHtml(rawCode, lang)
}
}
}
}
}
我有
Error
/home not found
但是当我删除highlighter
内容中的方法时,一切正常。任何人都可以帮助我吗?