Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我无法使用waline评论 #75

Closed
youyou-sudo opened this issue Sep 2, 2022 · 11 comments
Closed

我无法使用waline评论 #75

youyou-sudo opened this issue Sep 2, 2022 · 11 comments

Comments

@youyou-sudo
Copy link
Contributor

在更新主题之后,查看到有waline的相关配置,我将下方waline的JS URL更新为https://unpkg.com/@waline/client@v2/dist/waline.js
把相关的开关打开并配置好waline评论链接后,文章评论直接关闭了,由于我储备的开发知识很少,实在不知道问题出在哪里了,请求帮助,万分感谢

@zchengsite
Copy link
Owner

能否贴出相关配置文件代码,我这边看下

@youyou-sudo
Copy link
Contributor Author

youyou-sudo commented Sep 7, 2022

能否贴出相关配置文件代码,我这边看下

我的_config.oranges.yml文件中评论相关的配置,为确保主题为最新,我直接重新git拉了主题文件下来了。

# 文章评论系统
comments:
  enable: true
  # 目前仅支持gitalk, valine, disqus评论,选择喜欢的一种开启即可

  gitalk:
    # https://github.com/gitalk/gitalk#usage查看官方教程
    enable: false
    clientID:
    clientSecret:
    repo:
    owner:
    admin:
    id: location.pathname
    distractionFreeMode: false

  valine:
    # https://valine.js.org/quickstart.html#%E8%8E%B7%E5%8F%96APP-ID-%E5%92%8C-APP-Key
    # 进入以上网址查看官方教程
    enable: false
    appId: 
    appKey: 
    placeholder: Welcome!
    avatar: retro
    vempty_display: false

  # disqus 需科学上网方可使用
  disqus:
    # https://disqus.com/
    # 注册账号,获取shortname.disqus.com,shortname为你定义的唯一name
    # 例:我注册配置完毕后的网址为zxcxxxx.disqus.com,https-zxcxxxx-github-io即为shortname
    enable: false
    shortname: https-zxcxxxx-github-io
  
  # waline https://waline.js.org
  waline:
    enable: true
    serverURL: waline-deployment.vercel.app
  # 评论系统
  comments:
    gitalk:
      enable: false
      url:
        css: https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css
        js: https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js

    valine:
      enable: false
      url: https://cdn.jsdelivr.net/npm/[email protected]/dist/Valine.min.js

    waline:
      enable: true
      url: https://unpkg.com/@waline/client@v2/dist/waline.js

@zchengsite
Copy link
Owner

配置看起来没有什么问题
能否运行起来,看下控制台是否有报错
如有报错,贴出来看看

@youyou-sudo
Copy link
Contributor Author

youyou-sudo commented Dec 13, 2022

非常抱歉因为一些琐事,让我忘记了这件事
我在hexo g hexo s时,我的控制台并没有提示任何异常
image

@zchengsite
Copy link
Owner

我的意思是在浏览器控制台看看有无报错,有的话截图看下

@hiBlunt
Copy link

hiBlunt commented Feb 13, 2023

您好,我也遇到了waline无法使用的问题。
oranges版本:

PS C:\Users\huang\Desktop\SourceCode\blog> git submodule status
 1a6c04a48d6f33d920cd5bdbe1b4c9f5854ebe6f themes/oranges (1.0.0-63-g1a6c04a)

waline版本: v2.14.7,且直接访问severURL对应地址,功能正常,如图1所示
打开浏览器报错下:(图2)

Uncaught SyntaxError: Unexpected token 'export' (at waline.mjs:1:152946)
(索引):282 Uncaught ReferenceError: Waline is not defined
    at loadWalineSuc ((索引):282:7)
    at HTMLScriptElement.onload ((索引):275:129)

通过查阅waline官方文档我有如下两个疑点:
1.waline给出的示例中引入了css和mjs文件,但主题配置文件theme.cdns.comments.waline.url只引入一个文件,请问这里是否需要修改?
2.浏览器报错显示Waline未定义,并且代码waline初始化方式与官方示例不同,请问这两种方式有什么区别?

因为我并不了解前端技术,希望您在百忙之中抽出时间回复。
图1
图2

@hiBlunt
Copy link

hiBlunt commented Feb 28, 2023

问题已解决,waline从v1版本升级到了v2版本,Oranges需要重新适配。
因为作者长期未回复,我自己fork了一份并修复了该问题,传送门

@zchengsite
Copy link
Owner

问题已解决,waline从v1版本升级到了v2版本,Oranges需要重新适配。 因为作者长期未回复,我自己fork了一份并修复了该问题,传送门

实在不好意思,最近很忙,抽不出时间来维护。欢迎提pr,我审核后会合入主线,感谢反馈🙏。

@hiBlunt
Copy link

hiBlunt commented Feb 28, 2023

您好:PR已提交,但我并非专业前端,也不太了解node js,疏漏之处还请您多多指教。

@zchengsite
Copy link
Owner

您好:PR已提交,但我并非专业前端,也不太了解node js,疏漏之处还请您多多指教。

已合并,感谢贡献。

@tangluya
Copy link

tangluya commented Apr 4, 2023

@hiBlunt @jerryyang-git 各位老哥 冒昧打扰,想问下你们的waline评论可以正常展示吗?我的不知道为什么是竖着展示的。我在这里提交了一个issues:waline的一点问题 #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants