Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/geschke/hugo-tikva.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNolan Darilek <nolan@thewordnerd.info>2020-10-26 17:50:39 +0300
committerNolan Darilek <nolan@thewordnerd.info>2020-10-26 17:50:39 +0300
commitca02e5233fdf848d8eeffe29653d5a71bc77f399 (patch)
tree001d11f17339f56df20aa2d87d2ab78543b00d20
parent223965dee43f7baa8871af8d190a21a25fdcde56 (diff)
Respect word count display setting in post summary.
Also, fix possible case consistency issue between variable in template and setting.
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/_default/summary.html3
2 files changed, 3 insertions, 2 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 3319bdd..15d72c9 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -2,7 +2,7 @@
{{ $dateFormat := .Site.Params.DateFormat | default "Mon Jan 2, 2006" }}
{{ $author := .Params.author | default .Site.Params.author }}
-{{ $showNumberOfWords := .Params.ShowNumberOfWords | default .Site.Params.ShowNumberOfWords }}
+{{ $showNumberOfWords := .Params.showNumberOfWords | default .Site.Params.showNumberOfWords }}
<h1>{{ .Title }}</h1>
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index 41bf339..034519e 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -1,5 +1,6 @@
{{ $dateFormat := .Site.Params.DateFormat | default "Mon Jan 2, 2006"}}
{{ $author := .Params.author | default .Site.Params.author }}
+{{ $showNumberOfWords := .Params.showNumberOfWords | default .Site.Params.showNumberOfWords }}
<article class="mb-5 post">
<header>
@@ -8,7 +9,7 @@
<div class="post-meta">{{ if .Site.Params.ShowDate }}<span class="byline-icon fa fa-clock-o" aria-hidden="true"></span> <span class="screen-reader-text">{{ i18n "date" }}: </span><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> - {{ end }}{{ if $author }}
<span class="byline-icon fa fa-user" aria-hidden="true"></span><span class="screen-reader-text">{{ i18n "author" }}: </span> {{ $author }} - {{ end }}
- {{ .FuzzyWordCount }} {{ i18n "words" }} </div>
+ {{ if $showNumberOfWords }}{{ .FuzzyWordCount }} {{ i18n "words" }}{{ end }} </div>
</header>
{{ .Summary }}