From 94b711c4421cb847c9bbb2f01089b5dc3c1ed039 Mon Sep 17 00:00:00 2001 From: budparr Date: Mon, 9 Apr 2018 10:40:19 -0400 Subject: [PATCH] Use CurrentSection for section heading Allows us to use section title instead of inferring from the folder. Also added some whitespace --- layouts/_default/single.html | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 59f4e58..59deb08 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,25 +8,28 @@

- {{/* Humanize removes hyphens and capitalizes the first word */}} - {{ humanize .Section | upper }} + {{/* + CurrentSection allows us to use the section title instead of inferring from the folder. + https://gohugo.io/variables/page/#section-variables-and-methods + */}} + {{with .CurrentSection.Title }}{{. | upper }}{{end}}

- {{ .Title }} + {{- .Title -}}

{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
- {{ .Content }} - {{ partial "tags.html" . }} + {{- .Content -}} + {{- partial "tags.html" . -}}