From 008cf21abf3ef2ae12cecbab4981a425a7c70727 Mon Sep 17 00:00:00 2001 From: lafleur Date: Mon, 16 Nov 2020 14:56:39 +0100 Subject: [PATCH] add scope partial --- layouts/partials/header.html | 2 +- layouts/partials/scope.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/scope.html diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 30a0c83..d1861a0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -20,7 +20,7 @@ {{ range $.Site.Sections }} {{ if eq $currentPage.Section .Section }} - {{ .Title | markdownify }} + {{ partial "scope.html" $currentPage }} {{ else }} diff --git a/layouts/partials/scope.html b/layouts/partials/scope.html new file mode 100644 index 0000000..d0ba720 --- /dev/null +++ b/layouts/partials/scope.html @@ -0,0 +1,5 @@ +{{- $pathList := split (trim (path.Dir .RelPermalink) "/") "/" -}} +{{- range $i, $val := $pathList -}} + {{- $val -}} + {{- if ne $i (sub (len $pathList) 1) }} > {{ end -}} +{{- end -}}