aboutsummaryrefslogblamecommitdiff
path: root/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html
blob: a89746c6ad8dab65ee5cd4c5c3f0c21c137af620 (plain) (tree)




















                                                                               
{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
<div id="cusdis_thread"
    data-host="{{ $host }}"
    data-app-id="{{ .Site.Params.comments.cusdis.id }}"
    data-page-id="{{ .File.UniqueID }}"
    data-page-url="{{ .Permalink }}"
    data-page-title="{{ .Title }}"></div>
<script async defer src="{{ $host }}/js/cusdis.es.js"></script>

<script>
    function setCusdisTheme(theme) {
        let cusdis = document.querySelector('#cusdis_thread iframe');
        if (cusdis) {
            window.CUSDIS.setTheme(theme)
        }
    }

    window.addEventListener('onColorSchemeChange', (e) => {
        setCusdisTheme(e.detail)
    })
</script>