hugo-geekdoc/layouts/partials/utils/title.html

12 lines
269 B
HTML
Raw Normal View History

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