enable comments on d-b.ca posts

This commit is contained in:
2025-11-25 09:56:04 -07:00
parent bf1498d3c5
commit dca59d5369
2 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
{{- with .Site.Params.remark42 -}}
<hr>
<p><b>Comments and questions are welcome!</b> <i>You can use your email address to Sign In (your email address is not publicly displayed), or you can use your Google or GitHub account. All comment data is hosted locally by d-b.ca and is not tracked. Please refer to the <a href='https://remark42.com' target="_blank"><b>Remark42</b></a> <a href='https://remark42.com/privacy/' target="_blank">Privacy Policy</a> for more information.</i></p>
<div id="remark42"></div>
<script>
var remark_config = {
host: '{{ .host }}',
site_id: '{{ .site }}',
components: ['embed'],
url: '{{ $.Permalink }}',
theme: document.documentElement.classList.contains("dark") ? 'dark' : 'light',
};
document.getElementById("appearance-switcher").addEventListener('click', event => {
window.REMARK42.changeTheme(document.documentElement.classList.contains("dark") ? 'light' : 'dark');
});
!function(e, n) {
for (var o = 0; o < e.length; o++) {
var r = n.createElement('script'),
c = '.js',
d = n.head || n.body;
'noModule' in r ? (r.type = 'module', c = '.mjs') : r.async = !0, r.defer = !0, r.src = remark_config.host + '/web/' + e[o] + c, d.appendChild(r)
}
}(remark_config.components || ['embed'], document);
</script>
{{- end -}}