Thomas Tang f532f491da Simplify configuration to optimize user experience and performance
Signed-off-by: Thomas Tang <hello@tangkunyin.com>
2024-08-09 13:16:27 +08:00

20 lines
882 B
Plaintext

<% if (theme.comments.enable){ %>
<% if (theme.comments.shortname) { %>
<div id="disqus_thread"></div>
<script>
if (location.origin === '<%= config.url %>') {
var disqus_config = function () {
this.page.url = location.href;
this.page.identifier = location.pathname;
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://<%=theme.comments.shortname %>.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>
<% } %>
<% } %>