From fb63c3395f662ddade2bc3013856d250387abe53 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 27 Dec 2017 22:41:47 +0000 Subject: [PATCH] Show recursive path in page title --- layouts/_default/baseof.html | 2 +- layouts/partials/title-item.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/title-item.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d7fc951..ed02e57 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,7 +10,7 @@ - {{ .Title }} :: {{ .Site.Title }} + {{ partial "title-item.html" (dict "page" . "current" .)}}{{ .Site.Title }} {{ partial "metadata.html" . }} diff --git a/layouts/partials/title-item.html b/layouts/partials/title-item.html new file mode 100644 index 0000000..2cd62aa --- /dev/null +++ b/layouts/partials/title-item.html @@ -0,0 +1,5 @@ +{{ .page.Title }} {{ if ne .age .current }}::{{ end }} + +{{ if .page.Parent }}{{ if not .page.Parent.IsHome }} +{{ partial "title-item.html" (dict "page" .page.Parent "current" .current) }} +{{ end }}{{ end }}