From 561659ed53a1eb1e7583513af5fa2faba55fca7e Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Mon, 17 Sep 2018 18:29:36 +0200 Subject: Improve page title handling and side menu templates --- layouts/partials/docs/shared.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 layouts/partials/docs/shared.html (limited to 'layouts/partials/docs/shared.html') diff --git a/layouts/partials/docs/shared.html b/layouts/partials/docs/shared.html new file mode 100644 index 0000000..f7ba182 --- /dev/null +++ b/layouts/partials/docs/shared.html @@ -0,0 +1,11 @@ + +{{ 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 }} -- cgit v1.2.3