This commit is contained in:
Gleb A. 2025-02-27 22:01:53 +03:00 committed by GitHub
commit a7b28aee44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -21,8 +21,12 @@
} }
function lazyLoadDisqusJS() { function lazyLoadDisqusJS() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { const excludedHosts = ["localhost", "127.0.0.1"];
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; 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; return;
} }

View File

@ -18,9 +18,10 @@
proxy: {{- .proxy -}}, proxy: {{- .proxy -}},
}); });
(function () { (function () {
if ( const excludedHosts = ["localhost", "127.0.0.1"];
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1 const hostname = window.location.hostname;
) {
if (excludedHosts.includes(hostname)) {
document.getElementById("gitalk-container").innerHTML = document.getElementById("gitalk-container").innerHTML =
"Gitalk comments not available by default when the website is previewed locally."; "Gitalk comments not available by default when the website is previewed locally.";
return; return;