hugo-book/layouts/partials/docs/title.html
2019-08-06 11:33:42 +02:00

10 lines
288 B
HTML

{{ $title := .Title }}
{{ if and .IsSection .File }}
{{ $sections := split (trim .File.Dir "/") "/" }}
{{ $title = index ($sections | last 1) 0 | humanize | title }}
{{ else if and .IsPage .File }}
{{ $title = .File.BaseFileName | humanize | title }}
{{ end }}
{{ return $title }}