🐛 Fixed the comment enabled setting.

This commit is contained in:
elkan1788 2023-06-24 15:24:04 +08:00
parent 53f3a902c1
commit ee86b0d152
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if $.IsHome }} </h2> {{ else }} </h1> {{ end }} {{ if $.IsHome }} </h2> {{ else }} </h1> {{ end }}
{{ $comments := .Site.Params.postMeta.comments.enable }} {{ $isComment := and (.Scratch.Get "isComment") .Site.Params.postMeta.comments.enable }}
<div class="post-meta-container"> <div class="post-meta-container">
<div class="post-meta-items"> <div class="post-meta-items">
{{ partial "post/header_meta/created_date.html" . }} {{ partial "post/header_meta/created_date.html" . }}
@ -32,7 +32,7 @@
{{ if and .Site.Params.postMeta.views.enable (ne .Site.Params.postMeta.views.plugin "busuanzi") }} {{ if and .Site.Params.postMeta.views.enable (ne .Site.Params.postMeta.views.plugin "busuanzi") }}
{{ partial "post/header_meta/views.html" . }} {{ partial "post/header_meta/views.html" . }}
{{ end }} {{ end }}
{{ if $comments }} {{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }} {{ partial "post/header_meta/comments.html" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}
@ -42,8 +42,8 @@
{{ partial "post/header_meta/words.html" . }} {{ partial "post/header_meta/words.html" . }}
{{ partial "post/header_meta/readtime.html" . }} {{ partial "post/header_meta/readtime.html" . }}
{{ partial "post/header_meta/views.html" . }} {{ partial "post/header_meta/views.html" . }}
{{ if $comments }} {{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }} {{ partial "post/header_meta/comments.html" . }}
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

View File

@ -5,7 +5,7 @@
<span class="post-meta-item-text" title="{{ T "PostMeta.comments" }}"> <span class="post-meta-item-text" title="{{ T "PostMeta.comments" }}">
{{ print (T "PostMeta.comments") (T "Symbol.colon") }} {{ print (T "PostMeta.comments") (T "Symbol.colon") }}
</span> </span>
<span id="comments-count" {{ if and .Site.Params.postMeta.comments.enable (eq .Site.Params.postMeta.comments.plugin "waline") }}class="waline-comment-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}"> <span id="comments-count" {{ if eq .Site.Params.postMeta.comments.plugin "waline" }}class="waline-comment-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i> <i class="fa fa-sync fa-spin"></i>
</span> </span>
</span> </span>