uci-hugo-doc/layouts/partials/utils/title.html

12 lines
269 B
HTML
Raw Normal View History

2020-01-12 06:33:02 -08:00
{{ $title := "" }}
{{ if .Title }}
2020-04-15 00:20:00 -07:00
{{ $title = .Title }}
2020-01-12 06:33:02 -08:00
{{ else if and .IsSection .File }}
2020-04-15 00:20:00 -07:00
{{ $title = path.Base .File.Dir | humanize | title }}
2020-01-12 06:33:02 -08:00
{{ else if and .IsPage .File }}
2020-04-15 00:20:00 -07:00
{{ $title = .File.BaseFileName | humanize | title }}
2020-01-12 06:33:02 -08:00
{{ end }}
{{ return $title }}