make title generation cross-platform
This commit is contained in:
parent
90f9d9a49a
commit
daa0d0744b
1 changed files with 3 additions and 4 deletions
|
@ -1,12 +1,11 @@
|
|||
{{ $title := "" }}
|
||||
|
||||
{{ if .Title }}
|
||||
{{ $title = .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 }}
|
||||
{{ $title = .File.BaseFileName | humanize | title }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $title }}
|
||||
|
|
Loading…
Reference in a new issue