Created
February 29, 2016 16:28
-
-
Save jschpp/0b268cab449bab19dd26 to your computer and use it in GitHub Desktop.
adding 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
diff --git a/_layouts/post.html b/_layouts/post.html | |
index e75c724..9f70c29 100644 | |
--- a/_layouts/post.html | |
+++ b/_layouts/post.html | |
@@ -23,5 +23,22 @@ layout: default | |
<div class="post-content" itemprop="articleBody"> | |
{{ content }} | |
</div> | |
+{% if page.comments %} | |
+ <div id="disqus_thread"></div> | |
+ <script> | |
+ var disqus_config = function () { | |
+ this.page.url = "{{ page.url | prepend: site.baseurl | prepend: site.url }}"; | |
+ this.page.identifier = "{{page.url}}"; | |
+ }; | |
+ (function() { // DON'T EDIT BELOW THIS LINE | |
+ var d = document, s = d.createElement('script'); | |
+ s.src = '//>>DISQUSSHORTNAME<<.disqus.com/embed.js'; | |
+ | |
+ s.setAttribute('data-timestamp', +new Date()); | |
+ (d.head || d.body).appendChild(s); | |
+ })(); | |
+ </script> | |
+ <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript> | |
+{% endif %} | |
</article> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment