Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Verkhoturov <paskal.07@gmail.com>2022-09-29 17:22:01 +0300
committerGitHub <noreply@github.com>2022-09-29 17:22:01 +0300
commit8826674b1fe4924be181453bcb87f03c722d7834 (patch)
treeb75351482e7dd321355f960eb04ba8a738e777fc
parentefd6f1de3793dfdfc4b3409967b0c42e9e83196c (diff)
fix(comments): update Remark42 source code (#683)
update remark42 source code Updated frontend code taken from https://remark42.com/docs/configuration/frontend/
-rw-r--r--layouts/partials/comments/provider/remark42.html18
1 files changed, 9 insertions, 9 deletions
diff --git a/layouts/partials/comments/provider/remark42.html b/layouts/partials/comments/provider/remark42.html
index 97196c8..fa284eb 100644
--- a/layouts/partials/comments/provider/remark42.html
+++ b/layouts/partials/comments/provider/remark42.html
@@ -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);