Skip to content

Commit e4635bf

Browse files
committed
Add initial Disqus integration.
1 parent dde7e44 commit e4635bf

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

_layouts/post.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,19 @@ <h2>Related Posts</h2>
2222
{% endfor %}
2323
</ul>
2424
</div>
25+
26+
<div id="disqus_thread"></div>
27+
<script type="text/javascript">
28+
var disqus_shortname = 'code-logic';
29+
var disqus_identifier = '{{ page.url }}';
30+
var disqus_url = 'http://code.logic.net{{ page.url }}';
31+
var disqus_title = '{{ page.title }}';
32+
33+
(function() {
34+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
35+
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
36+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
37+
})();
38+
</script>
39+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
40+
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ <h1 class="postTitle"><a href="{{ post.url }}">{{ post.title }}</a></h1>
1212
{% for c in post.categories %}
1313
<span class="postCategory">{{ c }}</span>{% if forloop.last != true %},{% endif %}
1414
{% endfor %}
15+
<br />
16+
<a id="more" href="{{ post.url }}#disqus_thread" data-disqus-identifier="{{ post.url }}">Comments</a>
1517
</p>
1618
</div>
1719
{% endfor %}
@@ -39,3 +41,13 @@ <h1 class="postTitle"><a href="{{ post.url }}">{{ post.title }}</a></h1>
3941
</div>
4042

4143
<br />
44+
45+
<script type="text/javascript">
46+
var disqus_shortname = 'code-logic';
47+
(function () {
48+
var s = document.createElement('script'); s.async = true;
49+
s.type = 'text/javascript';
50+
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
51+
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
52+
}());
53+
</script>

0 commit comments

Comments
 (0)