From a565da529fa410d11522ffc0e37df652ffb49975 Mon Sep 17 00:00:00 2001 From: Alvaro Torres Cogollo Date: Tue, 10 Nov 2020 22:05:56 +0100 Subject: [PATCH] Allow description text in toc-tree items --- exampleSite/content/usage/configuration.md | 6 ++++++ layouts/shortcodes/toc-tree.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/usage/configuration.md b/exampleSite/content/usage/configuration.md index 873c71b..e7131e8 100644 --- a/exampleSite/content/usage/configuration.md +++ b/exampleSite/content/usage/configuration.md @@ -170,6 +170,9 @@ weight = 10 # Set how many table of contents levels to be showed on page. geekdocToC = 3 +# Set a description for the current page. This will be shown in toc-trees objects +GeekdocDescription = + # Show a breadcrumb navigation bar at the top of each docs page. geekdocBreadcrumb = false @@ -207,6 +210,9 @@ weight: 10 # Set how many table of contents levels to be showed on page. geekdocToC: 3 +# Set a description for the current page. This will be shown in toc-trees objects +GeekdocDescription: + # Show a breadcrumb navigation bar at the top of each docs page. geekdocBreadcrumb: false diff --git a/layouts/shortcodes/toc-tree.html b/layouts/shortcodes/toc-tree.html index 310bd5a..3c46617 100644 --- a/layouts/shortcodes/toc-tree.html +++ b/layouts/shortcodes/toc-tree.html @@ -15,10 +15,10 @@
  • {{ if or .Content .Params.geekdocFlatSection }} - {{ partial "title" . }} + {{ partial "title" . }}{{ with .Params.GeekdocDescription }}: {{ . }}{{ else }}{{ end }} {{ else }} - {{ partial "title" . }} + {{ partial "title" . }}{{ with .Params.GeekdocDescription }}: {{ . }}{{ end }} {{ end }} {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}