Skip to content

Commit 4e3ccd4

Browse files
committed
🐛 [fix] modify replacement rule for disqus short-name Signed-off-by: chenxuanzzy <chenxsuan019@gmail.com>
1 parent ce1b1cc commit 4e3ccd4

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

public/views/shared/disqus.ejs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<div id="disqus_thread"></div>
22
<script nonce="<%= cspNonce %>">
3-
var disqus_config = function () {
4-
this.page.identifier = window.location.pathname.split('/').slice(-1)[0];
5-
};
6-
(function() {
7-
var d = document, s = d.createElement('script');
8-
s.src = 'https://<%= disqus.replace(/[^A-Za-z0-9]+/g, '') %>.disqus.com/embed.js';
9-
s.setAttribute('data-timestamp', +new Date());
10-
(d.head || d.body).appendChild(s);
11-
})();
3+
var disqus_config = function () {
4+
this.page.identifier = window.location.pathname.split('/').slice(-1)[0];
5+
};
6+
(function() {
7+
var d = document, s = d.createElement('script');
8+
s.src = 'https://<%= disqus.replace(/[^A-Za-z0-9-]+/g, '') %>.disqus.com/embed.js';
9+
s.setAttribute('data-timestamp', +new Date());
10+
(d.head || d.body).appendChild(s);
11+
})();
1212
</script>
13-
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
13+
<noscript
14+
>Please enable JavaScript to view the
15+
<a href="https://disqus.com/?ref_noscript"
16+
>comments powered by Disqus.</a
17+
></noscript
18+
>

0 commit comments

Comments
 (0)