mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 04:03:48 +01:00
fix(comments): update Remark42 source code (#683)
update remark42 source code Updated frontend code taken from https://remark42.com/docs/configuration/frontend/
This commit is contained in:
parent
efd6f1de37
commit
8826674b1f
1 changed files with 9 additions and 9 deletions
|
@ -2,10 +2,10 @@
|
|||
<div id="remark42"></div>
|
||||
<script>
|
||||
var remark_config = {
|
||||
host: "{{ .host }}",
|
||||
host: '{{ .host }}',
|
||||
site_id: '{{ .site }}',
|
||||
components: ['embed'],
|
||||
url: "{{ $.Permalink }}",
|
||||
url: '{{ $.Permalink }}',
|
||||
max_shown_comments: {{ default 15 .max_shown_comments }},
|
||||
theme: document.documentElement.dataset.scheme,
|
||||
page_title: '{{ $.Title }}',
|
||||
|
@ -13,14 +13,14 @@
|
|||
show_email_subscription: {{ default true .show_email_subscription }}
|
||||
};
|
||||
|
||||
(function (c) {
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' + c[i] + '.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
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']);
|
||||
}(remark_config.components || ['embed'], document);
|
||||
|
||||
window.addEventListener('onColorSchemeChange', (e) => {
|
||||
window.REMARK42.changeTheme(e.detail);
|
||||
|
|
Loading…
Reference in a new issue