Skip to content

Commit 1ca737f

Browse files
lamATnginxnginx-jack
authored andcommitted
TOC: Render TOC only for current page
1 parent b821047 commit 1ca737f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

layouts/partials/sidebar-list-pages.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
<span class="box-link partial"></span>
2121
{{ end }}
2222
<a href="{{ .Permalink }}" style="{{if eq $currentUrl .Permalink}}font-weight: bold;{{end}}">{{ .Title }} </a>
23-
{{- with .TableOfContents -}}
24-
{{- . -}}
25-
{{- end -}}
23+
{{ if eq $currentUrl .Permalink }}
24+
{{- with .TableOfContents -}}
25+
{{- . -}}
26+
{{- end -}}
27+
{{ end }}
2628
{{ end }}
2729
</li>
2830
{{ end }}

0 commit comments

Comments
 (0)