mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
Apply suggestions from code review
This commit is contained in:
parent
2602005e0d
commit
8fd9b098b2
@ -134,16 +134,12 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FolderPageOptions>> = (user
|
||||
}
|
||||
|
||||
function _getFolders(slug: FullSlug): SimpleSlug[] {
|
||||
var folderName = _dirname(slug)
|
||||
var folderName = path.dirname(slug ?? "") as SimpleSlug
|
||||
const parentFolderNames = [folderName]
|
||||
|
||||
while (folderName !== ".") {
|
||||
folderName = _dirname(folderName)
|
||||
folderName = path.dirname(folderName ?? "") as SimpleSlug
|
||||
parentFolderNames.push(folderName)
|
||||
}
|
||||
return parentFolderNames
|
||||
}
|
||||
|
||||
function _dirname(slug: string | undefined): SimpleSlug {
|
||||
return path.dirname(slug ?? "") as SimpleSlug
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user