Skip to content

Commit 0bb7736

Browse files
committed
fix: add disqus comment
1 parent 5121561 commit 0bb7736

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ target-blank:
3434
rel: nofollow
3535

3636
header_page_refs: ['about']
37+
38+
disqus:
39+
shortname: "pyweekly"

_includes/disqus_comments.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{%- if page.comments != false and jekyll.environment == "production" -%}
2+
3+
<div id="disqus_thread"></div>
4+
<script>
5+
var disqus_config = function () {
6+
this.page.url = '{{ page.url | absolute_url }}';
7+
this.page.identifier = '{{ page.url | absolute_url }}';
8+
};
9+
10+
(function() {
11+
var d = document, s = d.createElement('script');
12+
13+
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
14+
15+
s.setAttribute('data-timestamp', +new Date());
16+
(d.head || d.body).appendChild(s);
17+
})();
18+
</script>
19+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
20+
{%- endif -%}

0 commit comments

Comments
 (0)