0

我正在尝试将语法荧光笔与@nuxt/contentShiki一起使用。

在我的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内容中的方法时,一切正常。任何人都可以帮助我吗?

4

0 回答 0