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

github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Xianmin <xianmin12@gmail.com>2022-06-12 18:38:06 +0300
committerGitHub <noreply@github.com>2022-06-12 18:38:06 +0300
commit58d2cfc20cbe53fb3b1edf9fb622b8722e7519a4 (patch)
tree69d21c7320d81eed2ab56442b03215118dc181c2
parenta5a3522fb08a4d85d34bdb02aa156dcdac2c9ac4 (diff)
parent70775d9ebb23519d3a2fc633a36741d629ab4bba (diff)
Merge pull request #338 from paskal/paskal/remark42_embed
Don't embed remark42 on pages without comments form
-rw-r--r--layouts/partials/scripts.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index aed0885..18d83d5 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -242,14 +242,15 @@
<script id="dsq-count-scr" src="//{{ .Site.DisqusShortname }}.disqus.com/count.js" async></script>
{{ end }}
-{{ if .Site.Params.remark42Url }}
+{{ if and .Site.Params.remark42Url (or .Page.IsPage .IsHome) }}
<script>
var remark_config = {
host: '{{ .Site.Params.remark42Url }}',
site_id: '{{ .Site.Params.remark42SiteId | default "remark" }}',
components: [
+{{- if .Page.IsPage }}
'embed',
-{{ if and .Site.Params.commentCount.remark42.enable (not .Page.IsPage) -}}
+{{- else if and .Site.Params.commentCount.remark42.enable .IsHome }}
'counter',
{{- end }}
],