jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
7.1k stars 1.28k forks source link

[Bug]: 最新评论正在加载中 #1456

Closed Raccoon-njuse closed 7 months ago

Raccoon-njuse commented 7 months ago

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.12.0

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的瀏覽器? || What browse are you using?

Chrome

使用的系統? || What operating system are you using?

macOS

依賴插件 | Package dependencies Information

hexo-site@0.0.0 /Users/raccoon/blogs
├── hexo-blog-encrypt@3.1.9
├── hexo-deployer-git@4.0.0
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-hide-posts@0.4.0
├── hexo-lazyload-image@1.0.13
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-marked@6.2.0
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-butterfly@4.12.0
├── hexo-theme-fluid@1.9.7
├── hexo-theme-landscape@1.0.0
├── hexo-wordcount@6.0.1
└── hexo@7.1.0

問題描述 | Describe the bug

控制台报错:

image

_config.butterfly.yml配置:

image image

leancloud为国内开发版,未配置custom domain

image

valine评论系统可以正常使用

image

出現問題網站 | Website

raccoon.love

Raccoon-njuse commented 7 months ago

更正: 第二张截图开启的评论系统不是Waline,是valine

image
jerryc127 commented 7 months ago

配置 serverurl 啊

Raccoon-njuse commented 7 months ago

配置 serverurl 啊

image image image

意思是说,国内版leancloud必须绑定备案域名使用了吗,不可以再用共享域名白嫖了?

Raccoon-njuse commented 7 months ago

刚才测试了一下,换了twikoo评论系统,也是评论功能正常但是最新评论无法加载

image image

_config.butterfly.yml

# Twikoo
# https://github.com/imaegoo/twikoo
twikoo:
  envId: https://sweet-tulumba-f49b77.netlify.app/.netlify/functions/twikoo
  region: ap-shanghai
  visitor: false
  option:
# Comments System
# --------------------------------------

comments:
  # Up to two comments system, the first will be shown as default
  # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk
  use: Twikoo
  text: true # Display the comment name next to the button
  # lazyload: The comment system will be load when comment element enters the browser's viewport.
  # If you set it to true, the comment count will be invalid
  lazyload: false
  count: true # Display comment count in post's top_img
  card_post_count: true # Display comment count in Home Page
# Aside widget - Newest Comments
newest_comments:
  enable: true
  sort_order: # Don't modify the setting unless you know how it works
  limit: 6
  storage: 10 # unit: mins, save data to localStorage
  avatar: true

Twikoo云函数是按照这份文档部署的, https://twikoo.js.org/backend.html#netlify-部署 用的是netlify+MongoDB

image image
Raccoon-njuse commented 7 months ago

找到问题了,lazyload插件没有调成仅文章

# lazyload
lazyload:
  enable: true
  onlypost: true # optional
  loadingImg: # optional eg ./images/loading.gif
  isSPA: false # optional
  preloadRatio: 3 # optional, default is 1s
jerryc127 commented 7 months ago

主题本身就支持lazyload 不需要插件