summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts-end.html
diff options
context:
space:
mode:
authoramzrk22020-05-29 16:55:27 +0800
committeramzrk22020-05-29 16:55:27 +0800
commit594655b050145b7c3beab06166678940e613a79a (patch)
tree23184d72fb68b3bcb146536a425a3a571ae1367a /layouts/partials/scripts-end.html
parentd47a131ca03b813b26345c752d41cc8999a646ce (diff)
downloadhugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.tar.gz
hugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.tar.bz2
hugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.zip
Disqus support
Diffstat (limited to 'layouts/partials/scripts-end.html')
-rw-r--r--layouts/partials/scripts-end.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html
index ea37e5c..39b3a00 100644
--- a/layouts/partials/scripts-end.html
+++ b/layouts/partials/scripts-end.html
@@ -118,6 +118,22 @@
}
});
</script>
+{{ else if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.disqusShortname) }}
+<script>
+ // theme switch button
+ $('.btn .btn-toggle-mode').on('click', () => {
+ // toggle theme
+ toggleTheme();
+ // update medium background
+ updateMeidumTheme($('body').attr('data-theme'), mediumEvent);
+ // update disqus theme if available
+ if (DISQUS) {
+ DISQUS.reset({
+ reload: true
+ });
+ }
+ });
+</script>
{{ else }}
<script>
// theme switch button