Skip to content

Commit

Permalink
fix: index deleted by error using frontmatter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jun 17, 2022
1 parent a9b7594 commit dbcfe2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mkdocsPublisher/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ function getReceiptFolder(file: TFile, settings:MkdocsPublicationSettings, metad
}
if (frontmatter && frontmatter[settings.yamlFolderKey]) {
const category = frontmatter[settings.yamlFolderKey]
let parentCatFolder = category.split('/').at(-1)
parentCatFolder = parentCatFolder.length === 0 ? category.split('/').at(-2) : parentCatFolder
const parentCatFolder = !category.endsWith('/') ? category.split('/').at(-1): category.split('/').at(-2);
const fileName = settings.folderNote && parentCatFolder === file.name ? 'index.md' : file.name
path = folderRoot + frontmatter[settings.yamlFolderKey] + "/" + fileName;
}
Expand Down

0 comments on commit dbcfe2b

Please sign in to comment.