From 1c3f3d03e1682cd435363e354acae6dc936baef3 Mon Sep 17 00:00:00 2001
From: Eiko Wagenknecht <git@eiko-wagenknecht.de>
Date: Tue, 20 Feb 2024 17:06:53 +0000
Subject: [PATCH] fix(toc): correct type for minEntries param (#909)
---
quartz/plugins/transformers/toc.ts | 4 ++--
1 files 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 @@
export interface Options {
maxDepth: 1 | 2 | 3 | 4 | 5 | 6
- minEntries: 1
+ minEntries: number
showByDefault: boolean
collapseByDefault: boolean
}
@@ -52,7 +52,7 @@
}
})
- if (toc.length > opts.minEntries) {
+ if (toc.length > 0 && toc.length > opts.minEntries) {
file.data.toc = toc.map((entry) => ({
...entry,
depth: entry.depth - highestDepth,
--
Gitblit v1.10.0