mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 13:26:22 +00:00
fix(toc): correct type for minEntries param (#909)
This commit is contained in:
parent
3b266ee7d0
commit
1c3f3d03e1
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ import Slugger from "github-slugger"
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
maxDepth: 1 | 2 | 3 | 4 | 5 | 6
|
maxDepth: 1 | 2 | 3 | 4 | 5 | 6
|
||||||
minEntries: 1
|
minEntries: number
|
||||||
showByDefault: boolean
|
showByDefault: boolean
|
||||||
collapseByDefault: boolean
|
collapseByDefault: boolean
|
||||||
}
|
}
|
||||||
|
@ -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) => ({
|
file.data.toc = toc.map((entry) => ({
|
||||||
...entry,
|
...entry,
|
||||||
depth: entry.depth - highestDepth,
|
depth: entry.depth - highestDepth,
|
||||||
|
|
Loading…
Reference in a new issue