Improve page title handling and side menu templates
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<!-- 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 }}
|
||||
Reference in New Issue
Block a user