https://eugeneyan.com/rss 09月30日
网站评论迁移至Utterances教程
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了如何将网站评论从Discus迁移至Utterances,包括创建仓库、配置Utterances、上传评论等步骤,并提供了示例代码。

Today I learnt how to migrate comments on this site to Utterances. The comments functionality on this site has migrated from Discus to Commento and most recently, utterances. You can see the history in the comments here.

Here are the steps I took:

    Create a repo just for comments. Set up utteranc.es with the repo. Add the html below to my layout template.
<script src="https://utteranc.es/client.js"        repo="eugeneyan/eugeneyan-comments"        issue-term="url"        theme="github-light"        crossorigin="anonymous"        async></script>
{  "issue": {    "title": "Imported from some other system",    "body": "..."  },  "comments": [    {      "body": "comment",      "create_at": "timestamp"    }  ]}
    Read the json comments, clean them up, and upload via the GitHub API (code).

Now all comments are GitHub issues. Here’s an example of how it looks like in a post. One downside is that readers will need to login via GitHub to be able to comment; hope this isn’t too big of a barrier.

If you found this useful, please cite this write-up as:

Yan, Ziyou. (Sep 2020). Migrating Site Comments to Utterances. eugeneyan.com. https://eugeneyan.com/writing/migrating-to-utterances/.

or

@article{yan2020utterance,  title   = {Migrating Site Comments to Utterances},  author  = {Yan, Ziyou},  journal = {eugeneyan.com},  year    = {2020},  month   = {Sep},  url     = {https://eugeneyan.com/writing/migrating-to-utterances/}}
Share on:

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

网站评论 Utterances 迁移 GitHub API
相关文章