From 1c3f3d03e1682cd435363e354acae6dc936baef3 Mon Sep 17 00:00:00 2001 From: Eiko Wagenknecht Date: Tue, 20 Feb 2024 18:06:53 +0100 Subject: [PATCH] fix(toc): correct type for minEntries param (#909) --- quartz/plugins/transformers/toc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/transformers/toc.ts b/quartz/plugins/transformers/toc.ts index 4c31d20..bfc2f98 100644 --- a/quartz/plugins/transformers/toc.ts +++ b/quartz/plugins/transformers/toc.ts @@ -6,7 +6,7 @@ import Slugger from "github-slugger" export interface Options { maxDepth: 1 | 2 | 3 | 4 | 5 | 6 - minEntries: 1 + minEntries: number showByDefault: boolean collapseByDefault: boolean } @@ -52,7 +52,7 @@ export const TableOfContents: QuartzTransformerPlugin | undefin } }) - if (toc.length > opts.minEntries) { + if (toc.length > 0 && toc.length > opts.minEntries) { file.data.toc = toc.map((entry) => ({ ...entry, depth: entry.depth - highestDepth,