diff options
Diffstat (limited to 'layouts/partials/docs/title.html')
-rw-r--r-- | layouts/partials/docs/title.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/layouts/partials/docs/title.html b/layouts/partials/docs/title.html new file mode 100644 index 0000000..91d5f81 --- /dev/null +++ b/layouts/partials/docs/title.html @@ -0,0 +1,9 @@ +{{ $title := .Title }} +{{ if and .IsSection .File }} + {{ $sections := split (trim .File.Dir "/") "/" }} + {{ $title = index ($sections | last 1) 0 | humanize | title }} +{{ else if and .IsPage .File }} + {{ $title = .File.BaseFileName | humanize | title }} +{{ end }} + +{{ return $title }} |