Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
Shepherdzzx opened this issue May 18, 2024 · 1 comment
Closed
3 tasks done
Labels
🐛 bug Unexpected problem or unintended behavior

Comments

@Shepherdzzx
Copy link

Shepherdzzx commented May 18, 2024

请确认

  • 是当前最新的Release版本
  • 本地 hexo clean && hexo s ,而且清除浏览器缓存,任可复现
  • 已经排除是其他Hexo插件影响

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. 再次切换代码块高光并重复以上步骤可以发现效果仍如上

暂时解决方法

@Shepherdzzx Shepherdzzx added the 🐛 bug Unexpected problem or unintended behavior label May 18, 2024
@zkqiang
Copy link
Member

zkqiang commented May 27, 2024

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

@zkqiang zkqiang closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants