💄 Update use waline pageview & add to homepage. Close #41, #42

This commit is contained in:
凡梦星尘
2022-10-29 18:15:39 +08:00
parent ac712b9277
commit 146bf52038
7 changed files with 51 additions and 4 deletions

View File

@@ -27,6 +27,9 @@
{{ partial "post/header_meta/created_date.html" . }}
{{ partial "post/header_meta/update_date.html" . }}
{{ partial "post/header_meta/categories.html" . }}
{{ if and $.IsHome (not (isset .Params "extlink")) }}
{{ partial "post/header_meta/views.html" . }}
{{ end }}
</div>
{{- if not $.IsHome }}
<div class="post-meta-items">

View File

@@ -2,9 +2,6 @@
{{- if .Site.Params.leancloudVisitors.enable }}
{{- $pageViewId = "leancloud-visitors-count" }}
{{- end }}
{{- if .Site.Params.waline.pageView }}
{{- $pageViewId = "waline-pageview-count" }}
{{- end }}
{{- if .Site.Params.analytics.busuanzi.postViews }}
{{- $pageViewId = "busuanzi_value_page_pv" }}
{{- end }}
@@ -15,5 +12,7 @@
<span class="post-meta-item-text">
{{ print (T "PostViews") (T "SymbolColon") }}
</span>
<span id="{{ $pageViewId }}" data-path="{{ .RelPermalink | relLangURL }}"><i class="fa fa-sync fa-spin"></i></span>
<span {{ with $pageViewId }}id="{{ . }}"{{end}} {{ with .Site.Params.waline.pageView }}class="waline-pageview-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i>
</span>
</span>