utterances 是一个基于 Github issues 构建的轻量级评论插件。使用 Github 账号登录后才能评论。

安装主题

  • 关于maupassant主题:
    https://github.com/tufu9441/maupassant-hexo
  • 在hexo目录下 git bash命令框执行
    1
    2
    3
    git clone git@github.com:tufu9441/maupassant-hexo.git themes/maupassant
    cnpm install hexo-renderer-pug --save
    cnpm install hexo-renderer-sass --save
  • 编辑hexo 目录下_config.yml 修改主题
    1
    theme: maupassant
  • 在hexo目录下 git bash命令框启动
    1
    hexo s
    效果
    效果

配置 Github 仓库

由于是基于 Github issues,我们需要一个仓库来存储评论, 所以我们需要在 Github 上创建一个空库,并且必须是 pulbic 的,这样用户才可以查看并发布评论。

Github 仓库

安装 Github App

安装地址:https://github.com/apps/utterances

访问安装地址,进入安装页面,单击 Install 按钮;
utterances

选择关联的仓库,我们选择刚刚建好的仓库;
选择刚刚建好的仓库
至此,Github 端配置完成,接下来在网页或博客中配置使用 utterances。

使用 utterances

  • 编辑 Hexo 主题配置文件maupassant/_config.yml,添加以下配置:
    1
    2
    3
    4
    5
    utterances: ## See: https://utteranc.es
    enable: true ## If you want to use Utterances comment system, please set the value to true.
    repo: ## The repository utterances will connect to, e.g. tufu9441/comments
    identifier: title ## The mapping between blog posts and GitHub issues.
    theme: github-light ## Choose an Utterances theme which matches your blog.
  • 再次启动hexo
    1
    hexo s
    效果

评论