diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8faf1cef0f..52e0df0d31 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -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") }}