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