diff options
author | Ralf Geschke <ralf@kuerbis.org> | 2018-11-16 16:13:25 +0300 |
---|---|---|
committer | Ralf Geschke <ralf@kuerbis.org> | 2018-11-16 16:13:25 +0300 |
commit | 9541d62c2af57339757f081df5d2fec6f1a367f7 (patch) | |
tree | fcb728e07c4ec37b99e8b2f1197c23a0ebbe7902 | |
parent | 0fa87c430dbc0aea786e54ba744d77909150016a (diff) |
Fix showNumberOfWords option
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/_default/single.html | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 5c9a237..6146995 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -28,8 +28,8 @@ paginate = 2 subtitle = "Example of Subtitle" dateFormat = "02.01.2006" # Format dates with Go's time formatting - showDate = true # Show date on summaries. This is a global setting. If the date should be shown, you have to add a "date" parameter to the content files, otherwise the default value will be used, which is something you don't want. - showNumberOfWords = true # Show number of word on article header + showDate = true # true|false: Show date on summaries. This is a global setting. If the date should be shown, you have to add a "date" parameter to the content files, otherwise the default value will be used, which is something you don't want. + showNumberOfWords = false # true|false: Show number of word on article header of single content page # Navigation bar settings diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ef1ef63..2cc83cf 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,14 +2,14 @@ {{ $dateFormat := default "Mon Jan 2, 2006" .Site.Params.DateFormat }} {{ $author := .Params.author | default .Site.Params.author }} - +{{ $showNumberOfWords := .Params.ShowNumberOfWords | default .Site.Params.ShowNumberOfWords }} <h1>{{ .Title }}</h1> -{{ if not .Params.HideMeta }} + <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> -{{ end }} + {{ if $showNumberOfWords }}{{ .FuzzyWordCount }} {{ i18n "words" }}{{ end }} </div> + {{ .Content }} {{ end }}
\ No newline at end of file |