aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/shared.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/docs/shared.html')
-rw-r--r--layouts/partials/docs/shared.html11
1 files changed, 11 insertions, 0 deletions
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 @@
+<!-- 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 }}