diff options
author | Dmitry Verkhoturov <paskal.07@gmail.com> | 2022-06-06 17:14:11 +0300 |
---|---|---|
committer | Dmitry Verkhoturov <paskal.07@gmail.com> | 2022-06-06 17:16:43 +0300 |
commit | 70775d9ebb23519d3a2fc633a36741d629ab4bba (patch) | |
tree | 69d21c7320d81eed2ab56442b03215118dc181c2 | |
parent | a5a3522fb08a4d85d34bdb02aa156dcdac2c9ac4 (diff) |
don't embed remark42 on pages without comments form
Now remark42 configuration won't be loaded on pages
where neither comment form nor comments counter are present.
-rw-r--r-- | layouts/partials/scripts.html | 5 |
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 }} ], |