對於Blogger本身提供的留言板,個人覺得不合我的胃口,搜尋了一下,有蠻多人使用Disqus所提供的網路留言服務,感覺還不錯,於是找了一篇時間最新的教學文章,{ 鍵盤自耕農 }-將 Blogger 留言 轉換到 Disqus 平台,結果做到「Add xxx to my Blogger site」這步驟時,產生了一些問題,無論怎麼新增網頁都無法正確顯示,後來查看了官網的教學,Manually adding a Disqus gadget to Blogger,手動新增Disqus就成功了。
(1) 到Blogger後台→選擇左側「版面配置」
(2)選擇新增小工具→選擇HTML/JavaScript
(4)標題輸入Disqus,內容輸入<!-- Disqus comments gadget -->,如下圖,儲存
(5)將Disqusw從rightsidebarwidgets拖拉到mainblogsec,如下圖,拖拉之後,右上角儲存排列方式
(6)到Blogger後台→選擇左側「範本」→編輯Html
(7)於程式碼區塊,Ctrl+F搜尋Disqus,會找到這行程式碼
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b:widget id='HTML1' locked='false' title='Disqus' type='HTML'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b:widget id='HTML1' locked='false' mobile='yes' title='Disqus' type='HTML'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b:includable id='main'> | |
<!-- only display title if it's non-empty --> | |
<b:if cond='data:title != ""'> | |
<h2 class='title'><data:title/></h2> | |
</b:if> | |
<div class='widget-content'> | |
<data:content/> | |
</div> | |
<b:include name='quickedit'/> | |
</b:includable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<b:includable id='main'> | |
<script type='text/javascript'> | |
var disqus_shortname = 'EXAMPLE'; | |
var disqus_blogger_current_url = "<data:blog.canonicalUrl/>"; | |
if (!disqus_blogger_current_url.length) { | |
disqus_blogger_current_url = "<data:blog.url/>"; | |
} | |
var disqus_blogger_homepage_url = "<data:blog.homepageUrl/>"; | |
var disqus_blogger_canonical_homepage_url = "<data:blog.canonicalHomepageUrl/>"; | |
</script> | |
<b:if cond='data:blog.pageType == "item"'> | |
<style type='text/css'> | |
#comments {display:none;} | |
</style> | |
<script type='text/javascript'> | |
(function() { | |
var bloggerjs = document.createElement('script'); | |
bloggerjs.type = 'text/javascript'; | |
bloggerjs.async = true; | |
bloggerjs.src = '//'+disqus_shortname+'.disqus.com/blogger_item.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bloggerjs); | |
})(); | |
</script> | |
</b:if> | |
<style type='text/css'> | |
.post-comment-link { visibility: hidden; } | |
</style> | |
<script type='text/javascript'> | |
(function() { | |
var bloggerjs = document.createElement('script'); | |
bloggerjs.type = 'text/javascript'; | |
bloggerjs.async = true; | |
bloggerjs.src = '//'+disqus_shortname+'.disqus.com/blogger_index.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bloggerjs); | |
})(); | |
</script> | |
</b:includable> |
(8)儲存範本後,即可回前端網頁文章底步觀看成果!