From 9541d62c2af57339757f081df5d2fec6f1a367f7 Mon Sep 17 00:00:00 2001 From: Ralf Geschke Date: Fri, 16 Nov 2018 14:13:25 +0100 Subject: Fix showNumberOfWords option --- exampleSite/config.toml | 4 ++-- 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 }}

{{ .Title }}

-{{ if not .Params.HideMeta }} +
{{ if .Site.Params.ShowDate }} {{ i18n "date" }}: - {{ end }}{{ if $author }} {{ i18n "author" }}: {{ $author }} - {{ end }} - {{ .FuzzyWordCount }} {{ i18n "words" }}
-{{ end }} + {{ if $showNumberOfWords }}{{ .FuzzyWordCount }} {{ i18n "words" }}{{ end }} + {{ .Content }} {{ end }} \ No newline at end of file -- cgit v1.2.3