summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-04-21 22:53:33 +0800
committerReorx <novoreorx@gmail.com>2022-04-21 22:53:33 +0800
commitff711a0be216dddacb039bc58f492c42480484ae (patch)
treecb6df787ccb26672bd5bddd267352f61be207d7d
parent1d1bede0756bb72e721731c3b7b23753f829c1f9 (diff)
add comments_js partial
-rw-r--r--layouts/partials/comments_js.html3
-rw-r--r--layouts/partials/footer.html15
2 files changed, 17 insertions, 1 deletions
diff --git a/layouts/partials/comments_js.html b/layouts/partials/comments_js.html
new file mode 100644
index 0000000..cca3404
--- /dev/null
+++ b/layouts/partials/comments_js.html
@@ -0,0 +1,3 @@
+{{- /* Comments js area start */ -}}
+{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}}
+{{- /* Comments js area end */ -}}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 28d3086..03a932c 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -223,11 +223,16 @@
<script>
document.querySelectorAll('.masked-email').forEach((el) => {
el.innerText = atob(el.innerText);
+ el.classList.remove('masked-email')
})
</script>
{{- end -}}
+{{ if (.Param "comments") }}
+{{ partial "comments_js.html" . }}
+{{ end }}
+
{{- /* Search */}}
{{- if (eq .Layout `search`) -}}
<link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json">
@@ -249,7 +254,15 @@
<script src="{{ $instantclick.RelPermalink }}" data-no-instant
{{- if site.Params.assets.disableFingerprinting }}integrity="{{ $instantclick.Data.Integrity }}"{{- end }}
></script>
-<script data-no-instant>InstantClick.init();</script>
+<script data-no-instant>
+ // http://instantclick.io/scripts
+ // InstantClick.on('change', function(isInitialLoad) {
+ // if (isInitialLoad) {
+ // return;
+ // }
+ // });
+ InstantClick.init();
+</script>
{{- end }}
{{- end -}}