File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed
themes/pinetheme/layouts/documentation Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 22title : " Releases"
33draft : false
44toc : true
5+ toc_depth : 1
56menu :
67 docs :
78 title :
Original file line number Diff line number Diff line change 11---
22title : " Operating systems"
33draft : false
4+ toc_depth : 1
45menu :
56 docs :
67 title :
Original file line number Diff line number Diff line change 4444 < nav id ="TableOfContents ">
4545
4646 {{ $section := .Site.GetPage "section" (printf "/documentation/%s/" .Params.full_section) }}
47+
48+ <!-- Set the filename variable -->
49+ {{ $filename := .File.Filename }}
4750
4851 < div class ="toc-head "> Table of contents</ div >
52+
4953 < ul >
5054 {{ range $section.Pages.ByParam "menu.docs.weight"}}
51-
52- < li >
53- < a class ="sidebar-nav-subitem " href ="#{{ .Title | anchorize }} "> {{ .Title }}</ a >
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 }}
55+ <!-- Exclude self -->
56+ {{ if not (eq .File.Filename $filename) }}
57+ < li >
58+ < a class ="sidebar-nav-subitem " href ="#{{ .Title | anchorize }} "> {{ .Title }}</ a >
59+ <!-- not if "toc: false" is set-->
60+ {{ if not (eq .Params.toc false) }}
61+ <!-- Length limit -->
62+ {{ if lt (.TableOfContents | len ) 800 }}
63+ {{ .TableOfContents }}
64+ {{ end }}
5965 {{ end }}
60- {{ end }}
61- </ li >
62-
66+ </ li >
67+ {{ end }}
6368 {{ end }}
6469 </ ul >
6570
6873 {{ else }}
6974 {{ if ge (len (.TableOfContents)) 33 -}}
7075 < div class ="toc-head "> Table of contents</ div >
71- {{ .TableOfContents }}
76+ {{ $tocStartLevel := 2 }}
77+ {{ $tocDepth := default 2 .Params.toc_depth }}
78+ {{ $tocEndLevel := add $tocStartLevel (sub $tocDepth 1) }}
79+ {{ $tocOrdered := false }}
80+ {{ .Fragments.ToHTML $tocStartLevel $tocEndLevel $tocOrdered | safeHTML }}
7281 {{ end }}
7382 {{ end }}
7483
You can’t perform that action at this time.
0 commit comments