mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
refactor: site.params.comments -> site.Params.features.comment
BREAKING CHANGE See #2601
This commit is contained in:
1 parent
dba78beda6
commit
39e6f6142d
5 files changed
+9
-9
No files matched your search
@@ -1,4 +1,4 @@
|
||||
{{ $provider := trim (site.Params.comments.provider | lower) " " }}
|
||||
{{ $provider := trim (site.Params.features.comment.provider | lower) " " }}
|
||||
|
||||
{{ if $provider }}
|
||||
{{ $provider_tpl := printf "partials/comments/%s.html" $provider }}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div id="commento"></div>
|
||||
{{ $url := (printf "%s/js/commento.js" (site.Params.comments.commento.url | default "https://cdn.commento.io")) }}
|
||||
{{ $url := (printf "%s/js/commento.js" (site.Params.features.comment.commento.url | default "https://cdn.commento.io")) }}
|
||||
<script src="{{$url}}" defer></script>
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ if site.Params.comments.disqus.shortname }}
|
||||
{{ if site.Params.features.comment.disqus.shortname }}
|
||||
<div id="disqus_thread"></div>
|
||||
<script>
|
||||
var disqus_config = function () {
|
||||
@@ -12,7 +12,7 @@
|
||||
return;
|
||||
}
|
||||
var d = document, s = d.createElement('script'); s.async = true;
|
||||
s.src = 'https://' + {{site.Params.comments.disqus.shortname}} + '.disqus.com/embed.js';
|
||||
s.src = 'https://' + {{site.Params.features.comment.disqus.shortname}} + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Show Disqus comment count if enabled. */}}
|
||||
{{ $comments_provider := trim (site.Params.comments.provider | lower) " " }}
|
||||
{{ $comments_provider := trim (site.Params.features.comment.provider | lower) " " }}
|
||||
{{ $commentable_page := $page.Params.commentable }}
|
||||
{{ if (eq $comments_provider "disqus") | and (site.Params.comments.disqus.show_count | default true) | and $commentable_page }}
|
||||
{{ if (eq $comments_provider "disqus") | and (site.Params.features.comment.disqus.show_count | default true) | and $commentable_page }}
|
||||
<span class="middot-divider"></span>
|
||||
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
|
||||
{{ end}}
|
||||
|
||||
@@ -107,9 +107,9 @@
|
||||
|
||||
{{/* Disqus Comment Count JS. */}}
|
||||
{{/* Note: count can appear both in listing previews and on the content page itself. */}}
|
||||
{{ $comments_provider := trim (site.Params.comments.provider | lower) " " }}
|
||||
{{ if eq $comments_provider "disqus" | and (site.Params.comments.disqus.show_count | default true) }}
|
||||
<script id="dsq-count-scr" src="https://{{site.Params.comments.disqus.shortname}}.disqus.com/count.js" async></script>
|
||||
{{ $comments_provider := trim (site.Params.features.comment.provider | lower) " " }}
|
||||
{{ if eq $comments_provider "disqus" | and (site.Params.features.comment.disqus.show_count | default true) }}
|
||||
<script id="dsq-count-scr" src="https://{{site.Params.features.comment.disqus.shortname}}.disqus.com/count.js" async></script>
|
||||
{{end}}
|
||||
|
||||
{{ $js_search_params := dict }}
|
||||
|
||||
Reference in new issue
Block a user