diff --git a/lib/utils.js b/lib/utils.js index d83e68d..a75d261 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -76,7 +76,7 @@ export function toFilePath(slug) { export function toSlug(filePath) { - if (Node.isFile(filePath)) { + if (Node.isFile(filePath) && filePath.includes(postsDirectory)) { return filePath.replace(postsDirectory, '') .replaceAll('/','__') .replaceAll(' ','--')