fluid-dev / hexo-theme-fluid

:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
https://hexo.fluid-dev.com/
GNU General Public License v3.0
7.05k stars 1.11k forks source link

Bug:代码块高光修改后只在localhost生效,对远程部署的网页不生效 #1095

Closed Shepherdzzx closed 1 month ago

Shepherdzzx commented 1 month ago

请确认

Bug描述

在theme的config文件中选择highlightjs并改变代码高光后,上传至github,本地localhost改变代码块高光,但github上部署的blog并未改变代码块高光

复现步骤

  1. 新建全新的Hexo安装fluid主题
  2. 对任意一篇文章做出修改
  3. 在theme的config文件夹中修改代码块高光的style 例如

    # 代码高亮
     # Code highlight
     highlight:
       enable: true
    
       # 代码块是否显示行号
       # If true, the code block display line numbers
       line_number: true
    
       # 实现高亮的库,对应下面的设置
       # Highlight library
       # Options: highlightjs | prismjs
       lib: "highlightjs"
    
       highlightjs:
         # 在链接中挑选 style 填入
         # Select a style in the link
         # See: https://highlightjs.org/static/demo/
         style: "atom-one-light"
         style_dark: "hybrid"
    
       prismjs:
         # 在下方链接页面右侧的圆形按钮挑选 style 填入,也可以直接填入 css 链接
         # Select the style button on the right side of the link page, you can also set the CSS link
         # See: https://prismjs.com/
         style: "default"
         style_dark: "tomorrow night"
    
         # 设为 true 高亮将本地静态生成(但只支持部分 prismjs 插件),设为 false 高亮将在浏览器通过 js 生成
         # If true, it will be generated locally (but some prismjs plugins are not supported). If false, it will be generated via JS in the browser
         preprocess: false
  4. 进行hexo d,再进行hexo g与hexo s
  5. 对比两个网页代码块的高光可以发现localhost已经修改而远程部署的网页没有更改
  6. 再次切换代码块高光并重复以上步骤可以发现效果仍如上

暂时解决方法

zkqiang commented 1 month ago

请检查部署,静态页面不会出现这种情况