Closed xhege closed 2 years ago
如果可以,希望您能按照模板提供,以便我们排查出现的问题。
对Bug的描述:
复现Bug的方法:
相关的截图:
运行环境(如果该Bug的产生和环境有关,例如浏览器不兼容导致):
您的配置文件:
补充内容:
如果理解起来有困难的话,能否麻烦提供以下的文件或是数据:
package.json
文件_config.yml
文件这不是一个主题的样式问题,这是渲染器出错导致块代码被渲染成了行代码的模式
好的
站点目录的 package.json文件如下:
"name": "hexo-site", "version": "0.0.0", "private": true, "scripts": { "build": "hexo generate", "clean": "hexo clean", "deploy": "hexo deploy", "server": "hexo server" }, "hexo": { "version": "5.4.1" }, "dependencies": { "hexo": "^5.0.0", "hexo-blog-encrypt": "^3.1.6", "hexo-deployer-git": "^3.0.0", "hexo-generator-archive": "^1.0.0", "hexo-generator-category": "^1.0.0", "hexo-generator-index": "^2.0.0", "hexo-generator-searchdb": "^1.4.0", "hexo-generator-tag": "^1.0.0", "hexo-permalink-pinyin": "^1.1.0", "hexo-renderer-ejs": "^1.0.0", "hexo-renderer-marked": "^4.0.0", "hexo-renderer-pug": "^3.0.0", "hexo-renderer-stylus": "^2.0.1", "hexo-server": "^2.0.0", "hexo-theme-butterfly": "^4.1.0", "hexo-theme-landscape": "^0.0.3" } }
_config.yml 文件
permalink: posts/:title/ permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks abbrlink: alg: crc32 # 算法:crc16(default) and crc32 rep: hex # 进制:dec(default) and hex
source_dir: source public_dir: public tag_dir: tags archive_dir: archives category_dir: categories code_dir: downloads/code i18n_dir: :lang skip_render:
new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: enable: true # Open external links in new tab field: site # Apply to the whole site exclude: '' filename_case: 0 render_drafts: false post_asset_folder: false relative_link: false future: true highlight: enable: true line_number: true auto_detect: false tab_replace: '' wrap: true hljs: false prismjs: enable: true preprocess: true line_number: true tab_replace: ''
index_generator: path: '' per_page: 12 order_by: -date
default_category: uncategorized category_map: tag_map:
meta_generator: true
date_format: YYYY-MM-DD time_format: HH:mm:ss
updated_option: 'mtime'
per_page: 12 pagination_dir: page
include: exclude: ignore:
theme: Rebirth
大佬,我的问题解决了,好像是因为站点_config.yml文件默认highlight:和prismjs:渲染同时开启了,关闭其中一个代码块就正常显示了
大佬,我的问题解决了,好像是因为站点_config.yml文件默认highlight:和prismjs:渲染同时开启了,关闭其中一个代码块就正常显示了
好的,解决了就好!
如果有其他任何问题,欢迎随时 issue 联系 ✌
不过想到了也确实有可能是主题的问题,印象里 prismjs 是运行时渲染的,这块的结构不够丰富,似乎不是太好处理,所以更推荐使用 highlight 的说
文章中的Java代码块只能单行显示不清楚,代码高亮暗色背景不生效,没有代码复制按钮
主题_config.yml配置如下:
![](https://cdn.jsdelivr.net/gh/xhege/xhg-images/pei.jpg)