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