Skip to content

Commit b803cb3

Browse files
drselump14mmistakes
authored andcommitted
Replace old Disqus script with Universal Embed Code (mmistakes#1179)
* update embeddable disqus javascript * Update disqus.html
1 parent 448160a commit b803cb3

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed
+14-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
{% if site.comments.disqus.shortname %}
2-
<script type="text/javascript">
3-
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
4-
var disqus_shortname = '{{ site.comments.disqus.shortname }}';
5-
6-
/* * * DON'T EDIT BELOW THIS LINE * * */
7-
(function() {
8-
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
9-
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
10-
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
11-
})();
12-
13-
/* * * DON'T EDIT BELOW THIS LINE * * */
14-
(function () {
15-
var s = document.createElement('script'); s.async = true;
16-
s.type = 'text/javascript';
17-
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
18-
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
19-
}());
2+
<div id="disqus_thread"></div>
3+
<script>
4+
var disqus_config = function () {
5+
this.page.url = "{{ page.url | absolute_url }}"; // Replace PAGE_URL with your page's canonical URL variable
6+
this.page.identifier = "{{ page.id }}"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
7+
};
8+
(function() { // DON'T EDIT BELOW THIS LINE
9+
var d = document, s = d.createElement('script');
10+
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
11+
s.setAttribute('data-timestamp', +new Date());
12+
(d.head || d.body).appendChild(s);
13+
})();
2014
</script>
21-
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
22-
{% endif %}
15+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
16+
{% endif %}

0 commit comments

Comments
 (0)