hugo-theme-hilfe/layouts/partials/utils/title.html

12 lines
269 B
HTML
Raw Normal View History

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