hugo-book-theme/layouts/partials/docs/shared.html

12 lines
396 B
HTML
Raw Normal View History

<!-- These templates contains some more complex logic and shared between partials-->
{{ define "title" }}
{{- if .Pages -}}
{{ $sections := split (trim .Dir "/") "/" }}
{{ $title := index ($sections | last 1) 0 | humanize | title }}
{{- default .Title $title -}}
{{- else -}}
{{ $title := .File | humanize | title }}
{{- default .Title $title -}}
{{- end -}}
{{ end }}