hugo-geekblog/layouts/partials/title.html

16 lines
348 B
HTML
Raw Normal View History

2020-07-06 18:55:32 +00:00
{{ $title := "" }}
{{ if .Title }}
{{ $title = .Title }}
2020-07-06 18:55:32 +00:00
{{ else if and .IsSection .File }}
{{ $title = path.Base .File.Dir | humanize | title }}
2020-07-06 18:55:32 +00:00
{{ else if and .IsPage .File }}
{{ $title = .File.BaseFileName | humanize | title }}
2020-07-22 08:51:13 +00:00
{{ end }}
{{ if eq .Kind "term" }}
{{ $title = $title | humanize | title }}
2020-07-06 18:55:32 +00:00
{{ end }}
{{ return $title }}