为Hexo博客Next主题添加Schnack评论

本文主要记录schnack评论搭建步骤(服务端搭建未完成)。

Step 1

%BLOG_PATH%\themes\next\layout\_third-party\comments路径下创建schnack.swig文件

{% if theme.schnack and theme.schnack.enable  %}
  <script src="//blog.oaoa.me/embed.js"
    data-schnack-slug="post-slug"
    data-schnack-target=".comments">
  </script>
{% endif %}

Step 2

%BLOG_PATH%\themes\next\layout\_third-party\comments\index.swig文件中添加schnack.swig的引用

{% include 'schnack.swig' %}

Step 3

%BLOG_PATH%\themes\next\layout\_partials\comments.swig文件中,添加一个elseif代码块:

  {% elseif theme.schnack and schnack.enable %}
    <div class="comments" id="comments">
    </div>

Step 4

TODO: 服务端配置


vpshexo

301 Words

2017-12-22 01:11