Skip to content

Commit

Permalink
🐛 [fix] modify replacement rule for disqus short-name
Browse files Browse the repository at this point in the history
Signed-off-by: chenxuanzzy <chenxsuan019@gmail.com>
  • Loading branch information
chenxuanzzy committed Mar 3, 2022
1 parent ce1b1cc commit 07cfb29
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions public/views/shared/disqus.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<div id="disqus_thread"></div>
<script nonce="<%= cspNonce %>">
var disqus_config = function () {
this.page.identifier = window.location.pathname.split('/').slice(-1)[0];
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://<%= disqus.replace(/[^A-Za-z0-9]+/g, '') %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
var disqus_config = function () {
this.page.identifier = window.location.pathname.split('/').slice(-1)[0];
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://<%= disqus.replace(/[^A-Za-z0-9-]+/g, '') %>.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">comments powered by Disqus.</a></noscript>
<noscript
>Please enable JavaScript to view the
<a href="https://disqus.com/?ref_noscript"
>comments powered by Disqus.</a
></noscript
>

0 comments on commit 07cfb29

Please sign in to comment.