amehime / hexo-theme-shoka

Just For https://shoka.lostyu.me/
MIT License
894 stars 205 forks source link

代码块无法正常渲染 #111

Closed b1xcy closed 8 months ago

b1xcy commented 8 months ago

目前出现的问题是,只有使用

```language title

的格式才能正常渲染出mac样式,但是[link text] [mark] [command]等功能均无法实现 root_config.yml:

highlight:
  enable: false # edit for Theme.shoka
  line_number: true
  auto_detect: true
  tab_replace: ''
prismjs:
  enable: false # edit for Theme.shoka

root\themes\shoka_config.yml:

darkmode: true
...
vendors:
  css:
    katex: npm/katex@0.12.0/dist/katex.min.css
    comment: css/comment.css
    fancybox: combine/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css,npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
  js:
    pace: npm/pace-js@1.0.2/pace.min.js
    pjax: npm/pjax@0.2.8/pjax.min.js
    fetch: npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js
    anime: npm/animejs@3.2.0/lib/anime.min.js
    algolia: npm/algoliasearch@4/dist/algoliasearch-lite.umd.js
    instantsearch: npm/instantsearch.js@4/dist/instantsearch.production.min.js
    lazyload: npm/lozad@1/dist/lozad.min.js
    quicklink: npm/quicklink@2/dist/quicklink.umd.js
    fancybox: combine/npm/jquery@3.5.1/dist/jquery.min.js,npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js,npm/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js
    valine: gh/amehime/MiniValine@4.2.2-beta10/dist/MiniValine.min.js
    copy_tex: npm/katex@0.12.0/dist/contrib/copy-tex.min.js
    chart: npm/frappe-charts@1.5.0/dist/frappe-charts.min.iife.min.js

package.json:

...
  "dependencies": {
    "hexo": "^7.0.0",
    "hexo-algoliasearch": "^2.0.1",
    "hexo-autoprefixer": "^2.0.0",
    "hexo-deployer-git": "^4.0.0",
    "hexo-feed": "^1.1.2",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-multi-markdown-it": "^0.1.5",
    "hexo-renderer-stylus": "^3.0.0",
    "hexo-server": "^3.0.0",
    "hexo-symbols-count-time": "^0.7.1",
    "hexo-theme-landscape": "^1.0.0"
  }

package-lock.json:

"": {
      "name": "hexo-site",
      "version": "0.0.0",
      "dependencies": {
        "hexo": "^7.0.0",
        "hexo-algoliasearch": "^2.0.1",
        "hexo-autoprefixer": "^2.0.0",
        "hexo-deployer-git": "^4.0.0",
        "hexo-feed": "^1.1.2",
        "hexo-generator-archive": "^2.0.0",
        "hexo-generator-category": "^2.0.0",
        "hexo-generator-index": "^3.0.0",
        "hexo-generator-tag": "^2.0.0",
        "hexo-renderer-ejs": "^2.0.0",
        "hexo-renderer-multi-markdown-it": "^0.1.5",
        "hexo-renderer-stylus": "^3.0.0",
        "hexo-server": "^3.0.0",
        "hexo-symbols-count-time": "^0.7.1",
        "hexo-theme-landscape": "^1.0.0"
      }
    }

image1 image2

同时av-min.js发生报错

Uncaught (in promise) Error: Class or object doesn't exists. [404 GET https://avoscloud.com/1.1/cloudQuery]
    at new r (av-min.js:1:1)
    at av-min.js:1:1
llxlr commented 8 months ago

可能跟 hexo 版本太高的问题,我现在还在用 5.4,还有 _config.yml 除了关闭默认的渲染器,我的是这个配置:

# MarkDown渲染
markdown:
  render: # 渲染器设置
    html: true # 过滤 HTML 标签
    xhtmlOut: true # 使用 '/' 来闭合单标签 (比如 <br />)。
    breaks: true # 转换段落里的 '\n' 到 <br>。
    linkify: true # 将类似 URL 的文本自动转换为链接。
    typographer: false # 不替换常见的排版元素
    quotes: '“”‘’'
  plugins: # markdown-it 插件设置
    - plugin:
        name: markdown-it-abbr # 缩写插件
        enable: true
    - plugin:
        name: markdown-it-footnote # 脚注插件
        enable: true
    - plugin:
        name: markdown-it-toc-and-anchor
        enable: true
        options: # 文章目录以及锚点应用的 class 名称,shoka 主题必须设置成这样
          tocClassName: 'toc'
          anchorClassName: 'anchor'
    - plugin:
        name: markdown-it-multimd-table
        enable: true
        options:
          multiline: true
          rowspan: true
          headerless: true
    - plugin:
        name: ./markdown-it-furigana
        enable: true
        options:
          fallbackParens: "()"
    - plugin:
        name: ./markdown-it-spoiler
        enable: true
        options:
          title: "你知道得太多了"
    - plugin:
        name: ./markdown-it-prism
        enable: true
    - plugin:
        name: ./markdown-it-katex
        enable: true
    - plugin:
        name: ./markdown-it-mermaid
        enable: true
b1xcy commented 8 months ago

确实是hexo版本的问题

npm un hexo --save&&npm i hexo@5.4 --save

降级安装就行