mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-21 20:30:39 +00:00
make title generation cross-platform
This commit is contained in:
parent
90f9d9a49a
commit
daa0d0744b
@ -3,8 +3,7 @@
|
||||
{{ if .Title }}
|
||||
{{ $title = .Title }}
|
||||
{{ else if and .IsSection .File }}
|
||||
{{ $sections := split (trim .File.Dir "/") "/" }}
|
||||
{{ $title = index ($sections | last 1) 0 | humanize }}
|
||||
{{ $title = path.Base .File.Dir | humanize | title }}
|
||||
{{ else if and .IsPage .File }}
|
||||
{{ $title = .File.BaseFileName | humanize | title }}
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user