From f0d45fe81f0c350dd2805bc0a7543fbd5f3beced Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 23 Mar 2021 22:58:01 +0100 Subject: Added breadcrumbs in the Docs section and display tags list in blog posts --- layouts/_default/single.html | 4 ++++ layouts/docs/list.html | 2 +- layouts/docs/single.html | 10 ++++++++++ layouts/partials/breadcrumbs.html | 13 +++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 layouts/docs/single.html create mode 100644 layouts/partials/breadcrumbs.html (limited to 'layouts') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa27b23..354384d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,8 +2,12 @@

{{ .Title }}

+

{{ if ne .PublishDate.Year 1 }}{{ .PublishDate.Format "2006-01-02" }} - {{ end }}{{ .Description }} +{{ if (isset .Params "tags") }}{{ if ge (len .Params.tags) 1 }}
Tag{{ if ge (len .Params.tags) 2 }}s{{ end }}: {{ range .Params.tags }}{{ . }} {{ end }}{{ end }}{{ end }} +

+ {{ partial "toc.html" . }} {{ .Content }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index bbd9f22..b6087f8 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -1,6 +1,6 @@ {{ define "main" }} -

{{ .Title }}

+{{ partial "breadcrumbs.html" . }} {{ with .Content }} {{ . }} diff --git a/layouts/docs/single.html b/layouts/docs/single.html new file mode 100644 index 0000000..124695b --- /dev/null +++ b/layouts/docs/single.html @@ -0,0 +1,10 @@ +{{ define "main" }} + +{{ partial "breadcrumbs.html" . }} + +{{ partial "toc.html" . }} + +{{ .Content }} + +{{ end }} + diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..814ec26 --- /dev/null +++ b/layouts/partials/breadcrumbs.html @@ -0,0 +1,13 @@ +

+{{ if ne .Parent nil }} +{{ if ne .Parent.Parent nil }} +{{ if ne .Parent.Parent.Parent nil }} +{{ .Parent.Parent.Parent.Title }} > +{{ end }} +{{ .Parent.Parent.Title }} > +{{ end }} +{{ .Parent.Title }} > +{{ end }} +{{ .Title }}
+{{ .Description }} +

-- cgit v1.2.3