Improve the site information display things.

This commit is contained in:
凡梦星尘
2022-09-12 10:22:22 +08:00
parent e79234935b
commit 5634c20a02
5 changed files with 107 additions and 51 deletions

View File

@@ -11,20 +11,11 @@
</div>
<div class="siteinfo-item">
<div class="item-name"><i class="fa fa-font"></i>{{ T "SiteInfoItems.words" }}</div>
<div class="item-count">
{{ $words := $scratch.Get "totalWords" }}
{{ if gt $words 10000 }}
{{ div $words 10000.0 | lang.FormatNumber 2 }}w
{{ else if gt $words 1000 }}
{{ div $words 1000.0 | lang.FormatNumber 2 }}k
{{ else }}
{{ $words }}
{{ end }}
</div>
<div class="item-count" id="wordsCount" data-count="{{ $scratch.Get "totalWords" }}"></div>
</div>
<div class="siteinfo-item">
<div class="item-name"><i class="fa fa-mug-hot"></i>{{ T "SiteInfoItems.readTimes" }}</div>
<div class="item-count">{{ $scratch.Get "totalTimes" }}min</div>
<div class="item-count" id="readTimes" data-times="{{ $scratch.Get "totalTimes" }}"></div>
</div>
{{ with .Site.Params.analytics.busuanzi }}
<div class="siteinfo-item">