fixup! feat: add subfolders to folder page: respect showSubfolders option

This commit is contained in:
Thomas Hack 2024-08-16 08:45:07 +02:00
parent 9dac4c8239
commit 2252f3bb43

View File

@ -46,12 +46,12 @@ export default ((opts?: Partial<FolderContentOptions>) => {
if (isDirectChild) {
allPagesInFolder.push(file)
} else {
} else if (options.showSubfolders) {
const folderSlug = joinSegments(...fileParts.slice(0, folderParts.length + 1)) as FullSlug
if (!allSubfolders.has(folderSlug)) {
allPagesInFolder.push(_createFolderData(folderSlug))
allSubfolders.add(folderSlug)
}
allSubfolders.add(folderSlug)
}
})