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

github.com/xiaoheiAh/hugo-theme-pure.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Hrusecky <michal@hrusecky.net>2020-10-28 21:48:19 +0300
committerMichal Hrusecky <michal@hrusecky.net>2020-10-28 21:48:19 +0300
commita107e0da98f7e0bddf70099a1e7318290edaab91 (patch)
treefbedef228961bb42d7672bc23c6e2051fc6aabba
parent5b9197f08c452c41d399adcbda394b78ac3308ac (diff)
Do not show comments if not defined
Disable showing comments icon and link if there is no defined way how to actually handle comments. To make blog work and look nicely even without comments.
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/article.html6
2 files changed, 7 insertions, 1 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 6cd7fd6..35481f0 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -29,7 +29,9 @@
{{- partial "post/date.html" . }}
{{- partial "post/category.html" . }}
{{- partial "post/tag.html" . }}
+ {{- if .Site.Params.comment.type }}
<span class="post-comment"><i class="icon icon-comment"></i> &nbsp;<a href="{{- .RelPermalink }}#comments" class="article-comment-link">{{- T "article_comments" }}</a></span>
+ {{- end }}
{{- partial "post/wc.html" . }}
</p>
</article>
diff --git a/layouts/partials/article.html b/layouts/partials/article.html
index ec979cf..ccbed3c 100644
--- a/layouts/partials/article.html
+++ b/layouts/partials/article.html
@@ -14,8 +14,10 @@
{{- partial "post/category.html" . }}
{{- partial "post/tag.html" . }}
{{- partial "post/pv.html" . }}
+ {{- if .Site.Params.comment.type }}
<span class="post-comment"><i class="icon icon-comment"></i>&nbsp;<a href="{{ .RelPermalink }}#comments"
class="article-comment-link">{{T "article_comments" }}</a></span>
+ {{- end }}
{{- partial "post/wc.html" . }}
</div>
</div>
@@ -26,7 +28,9 @@
{{- partial "post/copyright.html" . }}
</div>
</article>
+ {{- if (.Site.Params.comment.type) }}
{{- partial "post/comment.html" . }}
+ {{- end }}
</div>
{{- partial "post/nav.html" . }}
-{{- partial "post/donate.html" . }} \ No newline at end of file
+{{- partial "post/donate.html" . }}