Skip to content

Commit

Permalink
Global toggle for disqus. Use identifier as title incase urls change …
Browse files Browse the repository at this point in the history
…in the future
  • Loading branch information
ebidel committed Jul 11, 2013
1 parent e1cd428 commit ef02751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ load_platform: true
project_title: Polymer
latest_version: 0.0.20130711
add_permalinks: true # adds permalinks to heading tags.
load_disqus: true

authors:
ebidel:
Expand Down
4 changes: 4 additions & 0 deletions _includes/disqus.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{% if site.load_disqus %}
<hr>

<div id="disqus_thread"></div>
<script>
var disqus_shortname = 'polymer-project';
var disqus_url = location.protocol + '//' + location.host + '{{page.url}}';
{% if page.title %}var disqus_identifier = "{{page.title | downcase | replace:' ','-'}}";{% endif %}

(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);
})();
</script>

{% endif %}

0 comments on commit ef02751

Please sign in to comment.