Skip to content

Commit

Permalink
add disqus
Browse files Browse the repository at this point in the history
  • Loading branch information
alperenbozkurt committed Jul 18, 2017
1 parent f4c78d8 commit fc3827e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ youtube: username
# paginate: 5
# paginate_path: "blog/:num/"


# Comments
disqus_shortname: bozkurttalperen


# Gems
gems:
- jekyll-mentions
Expand Down
17 changes: 17 additions & 0 deletions _includes/disqus_comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if site.disqus_shortname %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endif %}
4 changes: 4 additions & 0 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
})();
</script>
{% endif %}

{% if page.comments != false %}
{% include disqus_comments.html %}
{% endif %}
5 changes: 5 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ <h2>{{ page.title }}</h2>
</div>
</div>
{% include scripts.html %}

{% if page.comments and site.disqus_shortname %}
<section id="disqus_thread" class="animated fadeInUp"></section>
<!-- /#disqus_thread -->
{% endif %}
</div>
</div>
{% include footer.html %}
Expand Down
5 changes: 5 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ <h2>{{ page.title }}</h2>
</div>
</div>
{% include scripts.html %}

{% if page.comments and site.disqus_shortname %}
<section id="disqus_thread" class="animated fadeInUp"></section>
<!-- /#disqus_thread -->
{% endif %}
</div>
</div>
{% include footer.html %}
Expand Down

0 comments on commit fc3827e

Please sign in to comment.