84dd80959a
* fix: make Disqus / Utterances follow the global color scheme * fix: check if DISQUS exists before executing DISQUS.reset closes https://github.com/CaiJimmy/hugo-theme-stack/issues/107
31 lines
882 B
HTML
31 lines
882 B
HTML
<script src="https://utteranc.es/client.js"
|
|
repo="{{ .Site.Params.comments.utterances.repo }}"
|
|
issue-term="{{ .Site.Params.comments.utterances.issueTerm }}"
|
|
theme="{{ .Site.Params.comments.utterances.theme }}"
|
|
{{ with .Site.Params.comments.utterances.label }}
|
|
label="{{ . }}"
|
|
{{ end }}
|
|
crossorigin="anonymous"
|
|
async>
|
|
</script>
|
|
|
|
<style>
|
|
.utterances {
|
|
max-width: unset;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
window.addEventListener('onColorSchemeChange', (e) => {
|
|
let utterances = document.querySelector('.utterances iframe');
|
|
if (utterances) {
|
|
utterances.contentWindow.postMessage(
|
|
{
|
|
type: 'set-theme',
|
|
theme: `github-${e.detail}`
|
|
},
|
|
'https://utteranc.es'
|
|
);
|
|
}
|
|
})
|
|
</script> |