mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 20:13:31 +08:00
.
This commit is contained in:
parent
0412cadfcf
commit
fb2b92dbbf
@ -21,23 +21,24 @@
|
||||
{ giscus: { setConfig: { theme: theme } } },
|
||||
"https://giscus.app"
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
(function(){
|
||||
const head = document.getElementsByTagName("html")[0];
|
||||
|
||||
addEventListener('message', handler)
|
||||
window.addEventListener('onColorSchemeChange', handler)
|
||||
addEventListener('message', handler);
|
||||
window.addEventListener('onColorSchemeChange', handler);
|
||||
|
||||
function handler() {
|
||||
if (head.getAttribute("data-scheme") == "light") {
|
||||
setGiscusTheme('{{- default "light" .lightTheme -}}');
|
||||
} else {
|
||||
setGiscusTheme('{{- default "dark_dimmed" .darkTheme -}}');
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
}());
|
||||
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user