mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 22:44:14 +02:00
fix: only show files that are actually in the folder
This commit is contained in:
parent
8cf3e3001f
commit
e34e1e0ff3
@ -36,7 +36,7 @@ export default ((opts?: Partial<FolderContentOptions>) => {
|
|||||||
|
|
||||||
allFiles.forEach((file) => {
|
allFiles.forEach((file) => {
|
||||||
const fileSlug = stripSlashes(simplifySlug(file.slug!))
|
const fileSlug = stripSlashes(simplifySlug(file.slug!))
|
||||||
const prefixed = fileSlug.startsWith(folderSlug) && fileSlug !== folderSlug
|
const prefixed = fileSlug.startsWith(`${folderSlug}/`) && fileSlug !== folderSlug
|
||||||
const fileParts = fileSlug.split(path.posix.sep)
|
const fileParts = fileSlug.split(path.posix.sep)
|
||||||
const isDirectChild = fileParts.length === folderParts.length + 1
|
const isDirectChild = fileParts.length === folderParts.length + 1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user