第四期:Twikoo赋能Hexo博客,快速搭建无缝评论系统

第四期: Twikoo赋能Hexo博客, 快速搭建无缝评论系统

1. 参考文档

  1. Twikoo文档
  2. MongoDB
  3. Vercel 部署

2. 获取 MongoDB 连接字符串

账号设置为 twikoo 密码自动获取(保存下来)

网段设置全网段

获取 MongoDB 连接字符串,替换 <db_password> 为自动获取的密码

3. Vercel 一键部署

添加环境变量 MONGODB_URI,值为前面记录的数据库连接字符串,例如:

1
mongodb+srv://twikoo:自动生成的密码@cluster0.y9hwz.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0

一定要看到 Twikoo 云函数运行正常 等字样才证明部署成功

自定义域名

4. anzhiyu配置

1
2
3
4
5
6
7
8
9
10
337 comments:
338 # Up to two comments system, the first will be shown as default
339 # Choose: Valine/Waline/Twikoo/Artalk
340 use: Twikoo # Twikoo/Waline
341 text: true # Display the comment name next to the button
342 # lazyload: The comment system will be load when comment element enters the browser's viewport.
343 # If you set it to true, the comment count will be invalid
344 lazyload: true
345 count: false # Display comment count in post's top_img
346 card_post_count: false # Display comment count in Home Page

1
2
3
4
5
6
7
383 # Twikoo
384 # https://github.com/imaegoo/twikoo
385 twikoo:
386 envId: https://twikoo.zetman.cn/
387 region:
388 visitor: true
389 option:

评论区测试成功(首次登录后台需要设置密码)