toc: fix display when empty #469

This commit is contained in:
Sören Weber 2023-02-10 17:15:48 +01:00
parent 0cc5ff2db6
commit 7252f82bb6
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -115,7 +115,7 @@
{{- $defaultDisableToc := .Site.Params.disableToc | default false }}
{{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }}
{{- $toc_content := partial "toc.html" . }}
{{- $hastoc := not (eq 0 (int (len ($toc_content | plainify)))) }}
{{- $hastoc := not (eq 0 (int (len (trim ($toc_content | plainify) "\n\t ")))) }}
{{- $toc := and $hastoc (not $currentDisableToc) (eq $outputFormat "html") }}
<div id="breadcrumbs">
<span id="sidebar-toggle-span">