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.11k stars 1.12k forks source link

无法显示评论 #355

Closed DurantVivado closed 3 years ago

DurantVivado commented 3 years ago

几乎所有评论都试过了,就是不显示。很绝望ORZ。全是按教程来的,部分配置如下:

评论功能

post: meta: author: # 作者,优先根据 front-matter 里 author 字段,其次是 hexo 配置中 author 值 enable: false date: # 文章日期,优先根据 front-matter 里 date 字段,其次是 md 文件日期 enable: true format: "dddd, MMMM Do YYYY, h:mm a" # 格式参照 ISO-8601 日期格式化 wordcount: # 字数统计 enable: true format: "{} 字" # 显示的文本,{}是数字的占位符(必须包含),下同 min2read: # 阅读时间 enable: true format: "{} 分钟" views: # 阅读次数 enable: true source: "busuanzi" # 统计数据来源,可选:leancloud | busuanzi 注意不蒜子会间歇抽风 format: "{} 次" comments: enable: true type: valine footnote: enable: true head: '' mermaid: enable: true specific: false options:

评论功能

post: meta: author: # 作者,优先根据 front-matter 里 author 字段,其次是 hexo 配置中 author 值 enable: false date: # 文章日期,优先根据 front-matter 里 date 字段,其次是 md 文件日期 enable: true format: "dddd, MMMM Do YYYY, h:mm a" # 格式参照 ISO-8601 日期格式化 wordcount: # 字数统计 enable: true format: "{} 字" # 显示的文本,{}是数字的占位符(必须包含),下同 min2read: # 阅读时间 enable: true format: "{} 分钟" views: # 阅读次数 enable: true source: "busuanzi" # 统计数据来源,可选:leancloud | busuanzi 注意不蒜子会间歇抽风 format: "{} 次" comments: enable: true type: valine footnote: enable: true head: '' mermaid: enable: true specific: false options:

valine: appid: '' # 从 LeanCloud 的应用中得到的 appId appkey: '' # 从 LeanCloud 的应用中得到的 APP Key placeholder: 说点什么 # 评论框占位提示符 path: window.location.pathname # 当前文章页路径,用于区分不同的文章页,以保证正确读取该文章页下的评论列表 avatar: retro # Gravatar 头像展示方式 meta: ['nick', 'mail', 'link'] # 评论者相关属性 pageSize: 10 # 评论列表分页,每页条数 lang: zh-CN # zh-CN | zh-TW | en | ja highlight: false # 代码高亮 recordIP: false # 是否记录评论者IP serverURLs: https://8ox7vcxy.lc-cn-n1-shared.com # REST API 服务器地址,国际版不填

gitalk: enable: true githubID: DurantVivado repo: Gitalk_warehouse ClientID: ClientSecret: admin: ['DurantVivado'] owner: DurantVivado id: location.pathname # The unique id of the page. Length must less than 50. language: zh-CN labels: ['Gitalk'] # GitHub issue labels. perPage: 10
pagerDirection: last # Comment sorting direction, available values are last and first. distractionFreeMode: false # Facebook-like distraction free mode. createIssueManually: true # By default, Gitalk will create a corresponding github issue for your every single page automatically when the logined user is belong to the admin users. You can create it manually by setting this option to true.

zkqiang commented 3 years ago
comments:
  enable: true
  type: valine

type指定的是valine,但是valine的配置都是空的

如果想用 gitalk,需要把 type: gitalk

再仔细看看文档吧...

DurantVivado commented 3 years ago
comments:
  enable: true
  type: valine

type指定的是valine,但是valine的配置都是空的

如果想用 gitalk,需要把 type: gitalk

再仔细看看文档吧...

感谢回复,我APPID和APPKEY都有了。您的意思是valine要放在type下面吗。

DurantVivado commented 3 years ago
comments:
  enable: true
  type: valine

type指定的是valine,但是valine的配置都是空的

如果想用 gitalk,需要把 type: gitalk

再仔细看看文档吧...

您可以看下我的网站 blog 看看哪里出问题了

zkqiang commented 3 years ago

你的 valine 都没有被加载(html搜索"valine"试试就知道了)

没加载的原因基本都是配置没有生效,否则至少加载后控制台有个报错

  1. 查看下是否错用了覆盖配置
  2. 可通过 hexo clean && hexo s --debug 查看打印的配置(也就是最终生效的配置)
DurantVivado commented 3 years ago

你的 valine 都没有被加载(html搜索"valine"试试就知道了)

没加载的原因基本都是配置没有生效,否则至少加载后控制台有个报错

  1. 查看下是否错用了覆盖配置
  2. 可通过 hexo clean && hexo s --debug 查看打印的配置(也就是最终生效的配置)

感谢您的帮助,我已经解决问题了,原因是我只在post的meta设置comments,而没有在post下设置comments。 hexo s --debug这个调试方法太好用了,感谢赐教O(∩_∩)O