Selaa lähdekoodia

refactor: site.params.comments -> site.Params.features.comment

BREAKING CHANGE

See #2601
George Cushen 3 vuotta sitten
vanhempi
commit
39e6f6142d

+ 1 - 1
wowchemy/layouts/partials/comments.html

@@ -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 - 1
wowchemy/layouts/partials/comments/commento.html

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

+ 2 - 2
wowchemy/layouts/partials/comments/disqus.html

@@ -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);
   })();

+ 2 - 2
wowchemy/layouts/partials/page_metadata.html

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

+ 3 - 3
wowchemy/layouts/partials/site_js.html

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