Twikoo 评论系统

一、注册 MongoDB

网址:MongoDB

  • 建议直接用谷歌注册。
  • 之后的小问卷随便填写,注意选择 Node.js 就行。

image

image

  • 填写名字就行,key 和 value 不必要填写。

image

  • 不需要加入别的成员,直接创建。

image

  • 接下来构建集群。

image

  • 选择免费的就可以。

image

  • 如图选择。

image

  • 点击添加用户(Create Database User),不要选择 Proceed to Connect,现在还不能直接连接。

image

image

  • 修改 IP 为(0.0.0.0)。

image

image

  • 选择 Drivers,Node.js,别关掉页面,接下来要用划线代码。

image

image

image

二、Vercel 部署

首先注册 Vercel,直接用 GitHub 登录就行。

打开网站:云函数部署 | Twikoo 文档

  • 点击 Vercel 部署。

image

  • 点击 Deploy,接下来如图所示。

image

  • 添加 GitHub 账户,起一个名字为你的仓库。

image

image

  • 等待至出现以下页面。

image

  • 回到 Vercel 主页面,接下来如图所示。

image

image

  • Key:MONGODB_URI
    Value:上文提到的代码,注意要把 <db_password> 换成自己设置的密码(尖括号也要去掉)。

image

  • 进入 Settings - Deployment Protection,设置 Vercel Authentication 为 Disabled。

image

  • 部署。

image

image

  • 显示以下为成功。

image

  • 点击划线。

image

  • 如图正常,复制网址。

image

三、博客部署

  • 修改为 Twikoo。

image

  • 粘贴网址到这里,之后 Hexo 三连就行(在终端里运行 hexo cl; hexo g; hexo d)。

image

四、删除 MongoDB

  • 如图。

image

image

image

image

image

image

image

image

image