feat: add detection of the theme version and Hugo version (#173)

* feat: add detection of the theme version and Hugo version

* fix: hugo.IsProduction is incompatible in Hugo v0.62.0
This commit is contained in:
Dillon
2020-03-16 21:35:16 +08:00
committed by GitHub
parent 9a7189c2a3
commit 41c2d3a38e
20 changed files with 53 additions and 26 deletions

View File

@@ -37,7 +37,7 @@
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>&nbsp;
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}&nbsp;
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}&nbsp;
{{- if $scratch.Get "production" | and .Site.Params.comment.valine.enable | and .Site.Params.comment.valine.visitor -}}
{{- if eq hugo.Environment "production" | and .Site.Params.comment.valine.enable | and .Site.Params.comment.valine.visitor -}}
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span>&nbsp;{{ T "views" }}
</span>&nbsp;