MOxFIVE / hexo-theme-yelee

简而不减 Hexo 双栏博客主题; Another simple and elegant theme for Hexo.
http://moxfive.xyz/
1.38k stars 328 forks source link

多说关闭之后,修改主题配置换成友言和Disqus都失败。 #189

Closed contropist closed 6 years ago

contropist commented 7 years ago

运行hexo g之后出现一堆错误。 希望作者可以更新主题,增加新评论框。

CharlesLiu7 commented 6 years ago

问题出在代码获取变量时theme.duoshuo.on变量获取不到报错(或者其它变量)。

修改方法:需要将多说关闭(显示地设置为false),即在_config.yaml中设置:

disqus:
  on: true
  shortname: 
  # https://help.disqus.com/customer/en/portal/articles/466208-what-s-a-shortname-
  # It is unnecessary to enable disqus here if 
  # you have set "disqus_shortname" in your site's "_config.yml" 

# 注意这里!!!打开多说设为false
duoshuo: 
  on: false
  # domain: 
  # 是否开启多说评论,http://duoshuo.com/create-site/
  # 使用上面网址登陆你的多说,然后创建站点,在 domain 中填入你设定的域名前半部分
  # http://<要填的部分>.duoshuo.com (domain只填上<>里的内容,不要填整个网址)

youyan:
  on: false
  # id: 
  # 是否开启友言评论,http://www.uyan.cc/index.php
  # id 中填写你的友言用户数字ID,注册后进入后台管理即可查看
  # 友言服务在 Web 环境下运行,普通本地环境无法查看,请部署后在线上测试。

这样,generate时不会报错。

利益相关:我能正常使用Disqus,没试过youyan。

xiaweizi commented 6 years ago

@CharlesLiu7 但是 disqus 没翻墙的显示不出来

contropist commented 6 years ago

多谢@CharlesLiu7 已经能使用disqus