summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramzrk22020-04-23 19:42:06 +0800
committeramzrk22020-04-23 19:42:06 +0800
commit0ed932121cd278fa1678e518728e7bb728bd1a9a (patch)
treef9999488f5fc0db69e3451320148cac4e9646083
parent39d85cc63387f940dcfd6cef1a6d43d2cc4ebdf1 (diff)
downloadhugo-theme-fuji-0ed932121cd278fa1678e518728e7bb728bd1a9a.tar.gz
hugo-theme-fuji-0ed932121cd278fa1678e518728e7bb728bd1a9a.tar.bz2
hugo-theme-fuji-0ed932121cd278fa1678e518728e7bb728bd1a9a.zip
Adjust comments settings
-rw-r--r--layouts/_default/single.html4
-rw-r--r--layouts/partials/comment-disqus.html10
-rw-r--r--layouts/partials/comment-utterances.html6
3 files changed, 10 insertions, 10 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 7bd92e8..6056021 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -20,10 +20,6 @@
</blockquote>
</div>
{{ end }}
-{{ if .Site.Params.utterancesComment }}
{{ partial "comment-utterances.html" . }}
-{{ end }}
-{{ if .Site.Params.disqusComment }}
{{ partial "comment-disqus.html" . }}
-{{ end }}
{{ end }} \ No newline at end of file
diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html
index 4477226..81c9c68 100644
--- a/layouts/partials/comment-disqus.html
+++ b/layouts/partials/comment-disqus.html
@@ -1,16 +1,18 @@
+{{ with .Site.Params.disqusShortname }}
<div id="post-comment">
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
- this.page.url = "{{ .Permalink }}";
- this.page.identifier = "{{ .RelPermalink }}";
+ this.page.url = "{{ $.Permalink }}";
+ this.page.identifier = "{{ $.RelPermalink }}";
};
(function () {
var d = document,
s = d.createElement('script');
- s.src = 'https://{{ .Site.Params.disqusShortname }}.disqus.com/embed.js';
+ s.src = 'https://{{ . }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
-</div> \ No newline at end of file
+</div>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/comment-utterances.html b/layouts/partials/comment-utterances.html
index b41aef4..b3edfbd 100644
--- a/layouts/partials/comment-utterances.html
+++ b/layouts/partials/comment-utterances.html
@@ -1,7 +1,9 @@
+{{ with .Site.Params.utterancesRepo }}
<div id="post-loading">
<i class="fas fa-circle-notch fa-spin"></i>
<p>{{ i18n "postCommentLoading" }}</p>
</div>
<div id="post-comment">
- <script src="{{ .Site.Params.cdnUtterancesJS }}" repo="{{ .Site.Params.utterancesRepo }}" issue-term="{{ .Site.Params.utterancesIssueTerm }}" theme="{{ .Site.Params.utterancesTheme }}" crossorigin="anonymous" async></script>
-</div> \ No newline at end of file
+ <script src="https://utteranc.es/client.js" repo="{{ . }}" issue-term="{{ $.Site.Params.utterancesIssueTerm }}" theme="{{ $.Site.Params.utterancesTheme }}" crossorigin="anonymous" async></script>
+</div>
+{{ end }} \ No newline at end of file