#186, Make title generation cross-platform

soper-book
Alex Shpak 2020-03-31 23:29:21 +02:00
parent a9867292af
commit b91e9eaea7
1 changed files with 1 additions and 2 deletions

View File

@ -7,8 +7,7 @@
{{ if .Title }}
{{ $title = .Title }}
{{ else if and .IsSection .File }}
{{ $sections := split (trim .File.Dir "/") "/" }}
{{ $title = index ($sections | last 1) 0 | humanize | title }}
{{ $title = path.Base .File.Dir | humanize | title }}
{{ else if and .IsPage .File }}
{{ $title = .File.BaseFileName | humanize | title }}
{{ end }}