From 7252f82bb64a16cbd681906e16615ef7951916a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 10 Feb 2023 17:15:48 +0100 Subject: [PATCH] toc: fix display when empty #469 --- layouts/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8faf1cef0f0..52e0df0d31b 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") }}