Allow description text in toc-tree items

uci-hugo-doc
Alvaro Torres Cogollo 2020-11-10 22:05:56 +01:00
parent 7ff16786bd
commit a565da529f
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -15,10 +15,10 @@
<li>
{{ if or .Content .Params.geekdocFlatSection }}
<span>
<a href="{{ .RelPermalink }}" class="gdoc-toc__entry">{{ partial "title" . }}</a>
<a href="{{ .RelPermalink }}" class="gdoc-toc__entry">{{ partial "title" . }}{{ with .Params.GeekdocDescription }}:</a> {{ . }}{{ else }}</a>{{ end }}
</span>
{{ else }}
<span>{{ partial "title" . }}</span>
<span>{{ partial "title" . }}{{ with .Params.GeekdocDescription }}: {{ . }}{{ end }}</span>
{{ end }}
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}