Skip to content

Commit

Permalink
fix: always show the TOC regardless of the screen sizes if the sideba…
Browse files Browse the repository at this point in the history
…r is disabled.
  • Loading branch information
razonyang committed Nov 17, 2022
1 parent 5361db4 commit 36dbb2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions layouts/partials/post/toc-wrapper.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{{- if partial "functions/toc" . -}}
<div id="postTOC" class="mt-2 mb-4 d-block d-xxl-none">
{{ $withoutSidebar := eq .Params.sidebar false }}
<div id="postTOC" class="mt-2 mb-4{{ if not $withoutSidebar }} d-block d-xxl-none{{ end }}">
<h2 class="text-surface mb-3">{{ i18n "table_of_contents" }}</h2>
<div id="post-toc-container">
{{/* Output the TOC if sidebar is disabled. */}}
{{ if eq .Params.sidebar false }}{{ .TableOfContents }}{{ end }}
{{- if $withoutSidebar }}
{{- .TableOfContents -}}
{{ end -}}
</div>
</div>
{{- end -}}

0 comments on commit 36dbb2c

Please sign in to comment.