CasonMo / comment-utterances

0 stars 0 forks source link

2022/05/08/Hexo-%E9%85%8D%E7%BD%AE%E8%AF%84%E8%AE%BA%E5%8A%9F%E8%83%BD/ #3

Closed utterances-bot closed 3 months ago

utterances-bot commented 1 year ago

Hexo 配置评论功能 - Blog|CasonMo

注意:本文以Fluid主题当示例来介绍如何配置评论,其他主题请根据对应用户手册配置 我是用的主题Fluid支持多种评论插件,utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis,每种插件有不同的配置方法,为了和评论用户有真实反馈、长久的交互和尽可能简单配置

https://casonmo.github.io/2022/05/08/Hexo-%E9%85%8D%E7%BD%AE%E8%AF%84%E8%AE%BA%E5%8A%9F%E8%83%BD/

Y0n3er commented 1 year ago

你好,我想问下为什么按照你的配置不出现评论框

CasonMo commented 1 year ago

你好,我想问下为什么按照你的配置不出现评论框

请问使用的是相同的主题吗,不同主题的配置会有些许不一样

Y0n3er commented 1 year ago

butterfly

wondon-tsuburaya commented 1 year ago

你好,请问landscape主题可以按这个配置吗😭

CasonMo commented 1 year ago

你好,请问landscape主题可以按这个配置吗😭

以下是我问chatgpt的 你可以试试😁

要在 Hexo 的 Landscape 主题中使用 Utterances 实现评论功能,您可以按照以下步骤进行配置:

在 GitHub 上创建一个新的存储库,用于存储 Utterances 评论。

打开 Utterances 的官方网站(https://utteranc.es/)。

在 Utterances 网站上,按照指示进行配置。选择您刚刚创建的 GitHub 存储库作为评论存储库,并选择适合您的偏好的其他选项。您可以选择主题、颜色和其他自定义设置。

在 Utterances 网站上生成配置代码后,将其复制到剪贴板。

在 Hexo 的根目录下,找到主题目录(themes/landscape/)。

在主题目录下,找到 layout/_partial/article.ejs 文件,打开它进行编辑。

在 article.ejs 文件中找到适当的位置(通常是文章正文的下方),将配置代码粘贴到该位置。例如:

<script src="https://utteranc.es/client.js"
     repo="your_github_username/your_repository_name"
     issue-term="pathname"
     theme="github-light"
     crossorigin="anonymous"
     async>
</script>

将 your_github_username/your_repository_name 替换为您在步骤 1 中创建的 GitHub 存储库的用户名和存储库名称。

保存并关闭 article.ejs 文件。

现在您可以重新生成 Hexo 的静态文件,并部署您的博客。使用以下命令重新生成静态文件:

Copy code hexo clean hexo generate 将生成的静态文件上传到您的服务器或托管平台。

现在您的 Hexo Landscape 主题应该已经配置了 Utterances 评论功能。请确保在 GitHub 存储库中配置了适当的评论设置,并确保在博客页面上正确显示评论框。

chergn commented 3 months ago

我用gitee搭建的博客,hexo fuild主题,也可以引入github的评论吗?

CasonMo commented 3 months ago

我用gitee搭建的博客,hexo fuild主题,也可以引入github的评论吗?

可以的

chergn commented 3 months ago

我用gitee搭建的博客,hexo fuild主题,也可以引入github的评论吗?

可以的

那太好了,有博客说明吗?教程指导👀。GitHub太慢了,我就部署在gitee了。但是没接入评论系统。我想接入GitHub的discussion

CasonMo commented 3 months ago

那太好了,有博客说明吗?教程指导👀 GitHub太慢了,我就部署在gitee了。但是没接入评论系统。我想接入GitHub的discussion

去谷歌搜索你用的主题+utterances就好了,应该有很多文章了,我这篇文章是fuild主题的关于utterances的配置的

CasonMo commented 3 months ago

去谷歌搜索你用的主题+utterances就好了,应该有很多文章了,我这篇文章是fuild主题的关于utterances的配置的

打不开😂

你用的什么主题?

chergn commented 3 months ago

打不开😂

你用的什么主题?

Fluid

CasonMo commented 3 months ago

打不开😂

你用的什么主题?

Fluid

如果你要用utterances 那你按着我这个文档配置不就可以了吗

chergn commented 3 months ago

utterances

utterances接入的评论系统是GitHub的issue。我想接入giscus 是GitHub的Discussion

CasonMo commented 3 months ago

utterances

utterances接入的评论系统是GitHub的issue。我想接入giscus 是GitHub的Discussion

fluid支持giscus, https://fluid-dev.github.io/hexo-fluid-docs/guide/#%E8%AF%84%E8%AE%BA

CasonMo commented 3 months ago

utterances

utterances接入的评论系统是GitHub的issue。我想接入giscus 是GitHub的Discussion

试一下以下配置

giscus:
  repo: 
  repo_id: 
  category: 
  category_id: 
  # Available values: pathname | url | title | og:title
  mapping: pathname
  # Available values: 0 | 1
  reactions_enabled: 1
   # Available values: 0 | 1
  emit_metadata: 0
  # Available values: light | dark | dark_high_contrast | transparent_dark | preferred-color-scheme
  theme: preferred_color_scheme
  # Available values: en | zh-CN
  lang: zh-CN
  # Place the comment box above the comments
  input_position: top
  comments:
    enable: true
    # 指定的插件,需要同时设置对应插件的必要参数
    # The specified plugin needs to set the necessary parameters at the same time
    # Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis
    type: giscus
chergn commented 3 months ago

fluid支持giscus, https://fluid-dev.github.io/hexo-fluid-docs/guide/#%E8%AF%84%E8%AE%BA

image
CasonMo commented 3 months ago

fluid支持giscus, https://fluid-dev.github.io/hexo-fluid-docs/guide/#%E8%AF%84%E8%AE%BA

image

晚点我也把utterances改成giscus试试 再跟你说结论 哈哈哈哈

chergn commented 3 months ago

晚点我也把utterances改成giscus试试 再跟你说结论 哈哈哈哈

哈哈哈哈哈,good👍 不如发篇博客,我看着学习学习👀

CasonMo commented 3 months ago

晚点我也把utterances改成giscus试试 再跟你说结论 哈哈哈哈

哈哈哈哈哈,good👍 不如发篇博客,我看着学习学习👀

没那么快出哦 要上班😵‍💫

chergn commented 3 months ago

没那么快出哦 要上班😵‍💫

真羡慕你,还是有班上