mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-28 19:43:31 +08:00
fix(gitalk): refactor local Gitalk loading check for improved readability
This commit is contained in:
parent
1950a66cd2
commit
758dc250c2
@ -18,9 +18,10 @@
|
||||
proxy: {{- .proxy -}},
|
||||
});
|
||||
(function () {
|
||||
if (
|
||||
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1
|
||||
) {
|
||||
const excludedHosts = ["localhost", "127.0.0.1"];
|
||||
const hostname = window.location.hostname;
|
||||
|
||||
if (excludedHosts.includes(hostname)) {
|
||||
document.getElementById("gitalk-container").innerHTML =
|
||||
"Gitalk comments not available by default when the website is previewed locally.";
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user