hugo-book-theme/layouts/partials/docs/title.html

10 lines
288 B
HTML
Raw Normal View History

2019-07-15 18:25:21 +02:00
{{ $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 }}