Yue-plus / hexo-theme-arknights

明日方舟罗德岛阵营的 Hexo 主题,支持数学公式、Valine&Gitalk&Waline评论系统、Mermaid图表
https://arknights.theme.hexo.yue.zone/
MIT License
660 stars 71 forks source link

评论过后会导致代码高亮出现问题 #35

Closed Blackfankt closed 2 years ago

Blackfankt commented 2 years ago

如图这是没有评论的: image 评论过后: image

Yue-plus commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。

另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

Blackfankt commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。

另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。 并且 在我有设置显示打赏时,文章末尾的打赏按钮也没有了。

Yue-plus commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。 另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。

点一下评论框再拉上去看也能正常显示?

我看到你 https://riceater.cn/ 中的打赏按钮还是在的,但评论框没了。

Orz

Blackfankt commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。 另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。

点一下评论框再拉上去看也能正常显示?

我看到你 https://riceater.cn/ 中的打赏按钮还是在的,但评论框没了。

Orz

额,刚刚我正好在调试把评论框关了。。。你说的“点一下评论框再拉上去看也能正常显示?”这个操作是怎么做到的。。。

Yue-plus commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。 另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。

点一下评论框再拉上去看也能正常显示? 我看到你 https://riceater.cn/ 中的打赏按钮还是在的,但评论框没了。 Orz

额,刚刚我正好在调试把评论框关了。。。你说的“点一下评论框再拉上去看也能正常显示?”这个操作是怎么做到的。。。

实际上我在查这个bug的时候打开你的网站是正常代码高亮的,然后点到评论框里,再拉上去点下代码框,代码框就会“大惊失色”。

Blackfankt commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。 另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。

点一下评论框再拉上去看也能正常显示? 我看到你 https://riceater.cn/ 中的打赏按钮还是在的,但评论框没了。 Orz

额,刚刚我正好在调试把评论框关了。。。你说的“点一下评论框再拉上去看也能正常显示?”这个操作是怎么做到的。。。

实际上我在查这个bug的时候打开你的网站是正常代码高亮的,然后点到评论框里,再拉上去点下代码框,代码框就会“大惊失色”。

嗯对,在更新之前确实有这样的bug,但是现在没有了,可另一个问题是打赏框不见了,我刚刚又关闭评论框在本地调试还是看不见它。。。

Yue-plus commented 2 years ago

主题已更新,请在主题目录下执行 git pull 更新主题。 另外,检查一下 Hexo 目录下的 _config.arknights.yml 文件,是否仍然引入了 cdn.bootcdn.net CDN 的 .js.css 文件,请删除引入。点击查看示例

感谢回复。 更新过后,带有评论的界面代码高亮还是会出现问题,当我删除引入之后发现代码高亮没有了之后将删除操作撤回就没有问题了。。。带有评论的界面也能正常显示。。。

点一下评论框再拉上去看也能正常显示? 我看到你 https://riceater.cn/ 中的打赏按钮还是在的,但评论框没了。 Orz

额,刚刚我正好在调试把评论框关了。。。你说的“点一下评论框再拉上去看也能正常显示?”这个操作是怎么做到的。。。

实际上我在查这个bug的时候打开你的网站是正常代码高亮的,然后点到评论框里,再拉上去点下代码框,代码框就会“大惊失色”。

嗯对,在更新之前确实有这样的bug,但是现在没有了,可另一个问题是打赏框不见了,我刚刚又关闭评论框在本地调试还是看不见它。。。

检查一下 Hexo 目录下的 _config.arknights.yml 和主题目录下的 _config.yml 文件中 post.reward 是否都为 true

# post 文章页面配置;true / false
post:
  date: true # 是否显示发布日期
  updated: true # 是否显示修改日期
  source: false # 是否显示源文件路径
  excerpt: false # 是否在文章中显示摘要内容(<!-- more--> 以上的内容)
  reward: true # 文章末显示打赏二维码                      《=================== 第23~26行附近

可以的话请把这俩文件贴上来。

Yue-plus commented 2 years ago

另外 Hexo 目录下的 package.json 也贴上来看看?

Blackfankt commented 2 years ago

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-asset-image": "^1.0.0",
    "hexo-browsersync": "^0.3.0",
    "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-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^4.1.0",
    "hexo-renderer-pug": "^2.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

主题目录下的_config.yml:

# html lang
language: zh

# canvas 动态背景
canvas_dust: true

# <body> 背景图片链接
background_image: https://ak.hypergryph.com/assets/index/images/ak/pc/bk.jpg # /img/bg.jpg

# 侧边栏
aside:
  in_left: false # 侧边栏在左 true / false
  logo: https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png # 图片链接,建议 1:1 比例
  dr: / # 侧边栏 Dr. 链接
  block_in_top: false # 目前为侧边栏文章目录置顶
  copyright: # 版权声明、备案号等,设置为 null 不显示
    ©: 2020 to 2021
    ICP: ——备案号——

# post 文章页面配置;true / false
post:
  date: true # 是否显示发布日期
  updated: false # 是否显示修改日期
  source: false # 是否显示源文件路径
  excerpt: false # 是否在文章中显示摘要内容(<!-- more--> 以上的内容)
  reward: true # 文章末显示打赏二维码
# 文章内目录
toc:
  list_number: true # true / false ;是否显示编号
  max_depth: 6 # 最大目录深度
  min_depth: 1 # 最小目录深度
# 归档页;true / false
archives:
  categories_count: true # 是否显示分类总数
  tags_count: true # 是否显示标签总数

# Valine 无后端评论系统
valine:
  enable: true
  app_id: ******
  app_key: ******

gitalk:
  enable: false
  clientID: # GitHub Application Client ID
  clientSecret: # GitHub Application Client Secret
  repo: # GitHub repository
  owner: # GitHub repository owner
  admin: ["''"] # GitHub repository owner and collaborators (Users who having write access to this repository)
                # Example: ["'adminA'","'adminB'"]
  id: # The unique id of the page
      # Example: location.pathname

# 图表支持
mermaid:
  enable: false
  version: '8.13.5'

# main menu navigation
menu:
  Home: ''
#  About: about/
#  Contact: contact/
  Archives: archives/

# stylesheets loaded in the <head>
stylesheets:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/styles/atom-one-dark-reasonable.min.css

# scripts loaded in the end of the body
scripts:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/highlight.min.js

emmm我hexo目录下没有设置_config.arknights.yml

Yue-plus commented 2 years ago

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-asset-image": "^1.0.0",
    "hexo-browsersync": "^0.3.0",
    "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-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^4.1.0",
    "hexo-renderer-pug": "^2.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

主题目录下的_config.yml:

# html lang
language: zh

# canvas 动态背景
canvas_dust: true

# <body> 背景图片链接
background_image: https://ak.hypergryph.com/assets/index/images/ak/pc/bk.jpg # /img/bg.jpg

# 侧边栏
aside:
  in_left: false # 侧边栏在左 true / false
  logo: https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png # 图片链接,建议 1:1 比例
  dr: / # 侧边栏 Dr. 链接
  block_in_top: false # 目前为侧边栏文章目录置顶
  copyright: # 版权声明、备案号等,设置为 null 不显示
    ©: 2020 to 2021
    ICP: ——备案号——

# post 文章页面配置;true / false
post:
  date: true # 是否显示发布日期
  updated: false # 是否显示修改日期
  source: false # 是否显示源文件路径
  excerpt: false # 是否在文章中显示摘要内容(<!-- more--> 以上的内容)
  reward: true # 文章末显示打赏二维码
# 文章内目录
toc:
  list_number: true # true / false ;是否显示编号
  max_depth: 6 # 最大目录深度
  min_depth: 1 # 最小目录深度
# 归档页;true / false
archives:
  categories_count: true # 是否显示分类总数
  tags_count: true # 是否显示标签总数

# Valine 无后端评论系统
valine:
  enable: true
  app_id: ******
  app_key: ******

gitalk:
  enable: false
  clientID: # GitHub Application Client ID
  clientSecret: # GitHub Application Client Secret
  repo: # GitHub repository
  owner: # GitHub repository owner
  admin: ["''"] # GitHub repository owner and collaborators (Users who having write access to this repository)
                # Example: ["'adminA'","'adminB'"]
  id: # The unique id of the page
      # Example: location.pathname

# 图表支持
mermaid:
  enable: false
  version: '8.13.5'

# main menu navigation
menu:
  Home: ''
#  About: about/
#  Contact: contact/
  Archives: archives/

# stylesheets loaded in the <head>
stylesheets:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/styles/atom-one-dark-reasonable.min.css

# scripts loaded in the end of the body
scripts:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/highlight.min.js

emmm我hexo目录下没有设置_config.arknights.yml

配置文件和依赖看起来貌似没有问题。

也许可以 先备份项目文件,然后再试试:

Blackfankt commented 2 years ago

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-asset-image": "^1.0.0",
    "hexo-browsersync": "^0.3.0",
    "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-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^4.1.0",
    "hexo-renderer-pug": "^2.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

主题目录下的_config.yml:

# html lang
language: zh

# canvas 动态背景
canvas_dust: true

# <body> 背景图片链接
background_image: https://ak.hypergryph.com/assets/index/images/ak/pc/bk.jpg # /img/bg.jpg

# 侧边栏
aside:
  in_left: false # 侧边栏在左 true / false
  logo: https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png # 图片链接,建议 1:1 比例
  dr: / # 侧边栏 Dr. 链接
  block_in_top: false # 目前为侧边栏文章目录置顶
  copyright: # 版权声明、备案号等,设置为 null 不显示
    ©: 2020 to 2021
    ICP: ——备案号——

# post 文章页面配置;true / false
post:
  date: true # 是否显示发布日期
  updated: false # 是否显示修改日期
  source: false # 是否显示源文件路径
  excerpt: false # 是否在文章中显示摘要内容(<!-- more--> 以上的内容)
  reward: true # 文章末显示打赏二维码
# 文章内目录
toc:
  list_number: true # true / false ;是否显示编号
  max_depth: 6 # 最大目录深度
  min_depth: 1 # 最小目录深度
# 归档页;true / false
archives:
  categories_count: true # 是否显示分类总数
  tags_count: true # 是否显示标签总数

# Valine 无后端评论系统
valine:
  enable: true
  app_id: ******
  app_key: ******

gitalk:
  enable: false
  clientID: # GitHub Application Client ID
  clientSecret: # GitHub Application Client Secret
  repo: # GitHub repository
  owner: # GitHub repository owner
  admin: ["''"] # GitHub repository owner and collaborators (Users who having write access to this repository)
                # Example: ["'adminA'","'adminB'"]
  id: # The unique id of the page
      # Example: location.pathname

# 图表支持
mermaid:
  enable: false
  version: '8.13.5'

# main menu navigation
menu:
  Home: ''
#  About: about/
#  Contact: contact/
  Archives: archives/

# stylesheets loaded in the <head>
stylesheets:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/styles/atom-one-dark-reasonable.min.css

# scripts loaded in the end of the body
scripts:
- //unpkg.com/@highlightjs/cdn-assets@11.4.0/highlight.min.js

emmm我hexo目录下没有设置_config.arknights.yml

配置文件和依赖看起来貌似没有问题。

也许可以 先备份项目文件,然后再试试:

  • 删除 Hexo 目录下的:

    • .deploy_git/
    • node_modules/
    • public/
    • db.json
    • yarn.lock
  • 在 Hexo 目录下执行 yarn 重新安装依赖
  • 在 Hexo 目录下执行 hexo server --debug 查看是否有报错
  • 如果没有报错的话可以试试 hexo d -g 重新编译部署
  • 如果还是不行的话,信任我的话可以加 QQ 群找群主远程控制搞一下

执行之后还是不行,之后我去阅读了源码,发现在post.pug文件中第61行这个if条件语句中的第二个条件可能我没有设置。然后我去看了之前版本的post.pug发现这一语句之前是没有第二个判断条件的,我删除了这一条件,打赏按钮便能正常显示了。 再次感谢大年三十依然能积极回复的开发者,祝新年快乐,万事如意。

Blackfankt commented 2 years ago

额今年好像没有三十是二十九,hhh