💄 Add comment counter in home & page.

This commit is contained in:
凡梦星尘
2022-10-30 11:43:18 +08:00
parent d609eecb23
commit e1c088c355
11 changed files with 91 additions and 46 deletions

View File

@@ -27,17 +27,25 @@
{{ partial "post/header_meta/created_date.html" . }}
{{ partial "post/header_meta/update_date.html" . }}
{{ partial "post/header_meta/categories.html" . }}
{{ if .Site.Params.waline.pageView }}
{{ if and $.IsHome (not (isset .Params "extlink")) }}
{{ partial "post/header_meta/views.html" . }}
{{ end }}
{{ end }}
{{ if and $.IsHome (not (isset .Params "extlink")) }}
<div class="post-meta-items">
{{ if .Site.Params.waline.pageView }}
{{ partial "post/header_meta/views.html" . }}
{{ end }}
{{ if .Site.Params.waline.comment }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}
</div>
{{- if not $.IsHome }}
<div class="post-meta-items">
{{ partial "post/header_meta/words.html" . }}
{{ partial "post/header_meta/readtime.html" . }}
{{ partial "post/header_meta/views.html" . }}
{{ if .Site.Params.waline.comment }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}
</div>

View File

@@ -0,0 +1,11 @@
<span class="post-meta-item" title="{{ T "PostComments" }}">
<span class="post-meta-item-icon">
<i class="far fa-comments"></i>
</span>
<span class="post-meta-item-text">
{{ print (T "PostComments") (T "SymbolColon") }}
</span>
<span {{ with .Site.Params.waline.comment }}class="waline-comment-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i>
</span>
</span>