title.html 269 B

123456789101112
  1. {{ $title := "" }}
  2. {{ if .Title }}
  3. {{ $title = .Title }}
  4. {{ else if and .IsSection .File }}
  5. {{ $title = path.Base .File.Dir | humanize | title }}
  6. {{ else if and .IsPage .File }}
  7. {{ $title = .File.BaseFileName | humanize | title }}
  8. {{ end }}
  9. {{ return $title }}