Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions _includes/my-comments.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{% assign disqus = site.disqus | default:site.disqus_shortname %}
{% if disqus %}

<!-- Fixing the Disqus iframe transparency issue on some browsers -->
<style>
:root {
color-scheme: light dark;
}
/* make sure Disqus iframe uses light mode */
iframe {
color-scheme: light;
}
</style>

<div id="disqus_thread"></div>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<script>!function(w, d) {
Expand All @@ -10,15 +22,33 @@
config() {
this.page.url = w.location.href;
this.page.title = d.title;
this.page.identifier = w.location.pathname.replace(/\/$/,'');
},
});
} else {
w.disqus_config = function disqusConfig() {
this.page.url = w.location.href;
this.page.title = d.title;
this.page.identifier = w.location.pathname.replace(/\/$/,'');
};
w.loadJSDeferred(d.getElementById("_hrefDisqus").href + '/embed.js');
w.loadJSDeferred(d.getElementById("_hrefDisqus").href + 'embed.js');
}
}

d.addEventListener('hydejack-dark-mode-toggle', (e) => {
setTimeout(() => {
if (w.DISQUS) {
w.DISQUS.reset({
reload: true,
config: function () {
this.page.url = w.location.href;
this.page.title = d.title;
this.page.identifier = w.location.pathname.replace(/\/$/,'');
}
});
}
}, 500);
});

}(window, document);</script>
{% endif %}
{% endif %}