本文來自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn
摘要:
- 由於現在我這個博客原來用的是DISQUS評論插件,那全是全球的,有些關聯被牆
- 所以我把評論插件換成國內的多說
登錄多說創建站點
*鏈接地址請點擊 多說站點創建地址
創建多說站點,填寫信息如下圖:

填寫完信息后,點擊創建,生成代碼,如下圖:

上圖代碼有三處地方需要修改,代碼中已經表示出來了,可以參照我的代碼:
<!-- 多說評論框 start -->
<div class="ds-thread"
data-thread-key="請將此處替換成你站點的ID" data-title="請替換成文章的標題" data-url="請替換成文章的網址"></div>
# 由於變量在這里寫了博客里會亂,所以替換方法見下面
<!-- 多說評論框 end -->
<!-- 多說公共JS代碼 start (一個網頁只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"galengao"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多說公共JS代碼 end -->
根據中文提示有三處修改,(注意把中括號換成大括號):
1、data-thread-key 我改為[[ site.url ]]_[[ page.title ]]
2、data-title 我改為[[ page.title ]]
3、data-url 我改為[[ site.url ]]
將此代碼粘貼到需要的位置,至於放在什么文件什么地方,取決於你所使用的模板
一般位置在_layouts/post.html
或者_layouts/default.html
