add comments_js partial

This commit is contained in:
Reorx 2022-04-21 22:53:33 +08:00
parent 1d1bede075
commit ff711a0be2
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,3 @@
{{- /* Comments js area start */ -}}
{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}}
{{- /* Comments js area end */ -}}

View File

@ -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 -}}