-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: output the TOC inside post content if the sidebar is disabled (#800
) Fix #798
- Loading branch information
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +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"></div> | ||
<div id="post-toc-container"> | ||
{{/* Output the TOC if sidebar is disabled. */}} | ||
{{- if $withoutSidebar }} | ||
{{- .TableOfContents -}} | ||
{{ end -}} | ||
</div> | ||
</div> | ||
{{- end -}} |