Skip to content

Commit 9c61e4d

Browse files
committed
Improved toc
1 parent fd96634 commit 9c61e4d

File tree

2 files changed

+10
-2
lines changed
  • content/documentation/PineTime
  • themes/pinetheme/layouts/documentation

2 files changed

+10
-2
lines changed

content/documentation/PineTime/FAQ.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "FAQ"
33
draft: false
4+
toc: false
45
menu:
56
docs:
67
title:

themes/pinetheme/layouts/documentation/single.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1>
3939
</div>
4040

4141
<div id="doc-toc">
42-
<!-- If on a full page -->
42+
<!-- Full pages -->
4343
{{ if isset .Params "full_section" }}
4444
<nav id="TableOfContents">
4545

@@ -51,13 +51,20 @@ <h1>
5151

5252
<li>
5353
<a class="sidebar-nav-subitem" href="#{{ .Title | anchorize }}">{{ .Title }}</a>
54-
{{ .TableOfContents }}
54+
<!-- not if "toc: false" is set-->
55+
{{ if not (eq .Params.toc false) }}
56+
<!-- Length limit -->
57+
{{ if lt (.TableOfContents | len ) 800 }}
58+
{{ .TableOfContents }}
59+
{{ end }}
60+
{{ end }}
5561
</li>
5662

5763
{{ end }}
5864
</ul>
5965

6066
</nav>
67+
<!-- Regular doc pages -->
6168
{{ else }}
6269
{{ if ge (len (.TableOfContents)) 33 -}}
6370
<div class="toc-head">Table of contents</div>

0 commit comments

Comments
 (0)