Skip to content

Commit

Permalink
fix(toc): correct type for minEntries param (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
eikowagenknecht authored Feb 20, 2024
1 parent 3b266ee commit 1c3f3d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quartz/plugins/transformers/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -52,7 +52,7 @@ export const TableOfContents: QuartzTransformerPlugin<Partial<Options> | 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,
Expand Down

0 comments on commit 1c3f3d0

Please sign in to comment.