Skip to content

Commit 23c2870

Browse files
lamATnginxnginx-jack
authored andcommitted
fix: Sidebar TOC render on root links
1 parent 762ec01 commit 23c2870

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

assets/css/v2/style.css

+1
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
937937
display: none;
938938
}
939939

940+
.current ~ nav,
940941
.collapsible-content li ul li:has(.current) > nav {
941942
/* Open TOC for current page */
942943
display: block !important;

layouts/partials/sidebar-v2.html

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
<span class="parent-box-link"></span>
8080
{{ end }}
8181
<a href="{{ .Permalink }}" style="{{if eq $.Permalink .Permalink}}font-weight: bold;{{end}}">{{ .Title }} </a>
82+
{{ if eq $.Permalink .Permalink }}
83+
{{- with .TableOfContents -}}
84+
{{- . -}}
85+
{{- end -}}
86+
{{ end }}
8287
{{ end }}
8388
</li>
8489
{{ end }}

0 commit comments

Comments
 (0)