mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-06-17 19:43:30 +08:00
fix(disqusjs): refactor local DisqusJS loading check for improved readability
This commit is contained in:
parent
9e6b7b22a9
commit
1950a66cd2
@ -21,8 +21,12 @@
|
||||
}
|
||||
|
||||
function lazyLoadDisqusJS() {
|
||||
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
||||
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
|
||||
const excludedHosts = ["localhost", "127.0.0.1"];
|
||||
const hostname = window.location.hostname;
|
||||
|
||||
if (excludedHosts.includes(hostname)) {
|
||||
document.getElementById('disqus_thread').innerHTML =
|
||||
'Disqus comments not available by default when the website is previewed locally.';
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user