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

11 lines
396 B
HTML

<!-- 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 }}