2021-10-31 05:15:57 -04:00
|
|
|
{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
|
2021-10-01 10:38:37 -04:00
|
|
|
<div id="cusdis_thread"
|
2021-10-31 05:15:57 -04:00
|
|
|
data-host="{{ $host }}"
|
2021-10-01 10:38:37 -04:00
|
|
|
data-app-id="{{ .Site.Params.comments.cusdis.id }}"
|
|
|
|
data-page-id="{{ .File.UniqueID }}"
|
|
|
|
data-page-url="{{ .Permalink }}"
|
|
|
|
data-page-title="{{ .Title }}"></div>
|
2021-10-31 05:15:57 -04:00
|
|
|
<script async defer src="{{ $host }}/js/cusdis.es.js"></script>
|
2021-10-01 10:38:37 -04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function setCusdisTheme(theme) {
|
|
|
|
let cusdis = document.querySelector('#cusdis_thread iframe');
|
|
|
|
if (cusdis) {
|
|
|
|
window.CUSDIS.setTheme(theme)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('onColorSchemeChange', (e) => {
|
|
|
|
setCusdisTheme(e.detail)
|
|
|
|
})
|
2021-10-31 05:15:57 -04:00
|
|
|
</script>
|