diff --git a/src/services/post-file.ts b/src/services/post-file.ts index 844b8e7..e88412f 100644 --- a/src/services/post-file.ts +++ b/src/services/post-file.ts @@ -13,6 +13,8 @@ export async function readPostFile(path: string): Promise { let slug = parsedData.slug; if (!slug) { + // get the last object in the path, remove the last three characters, + // presuming they are `.md` slug = path.split("/").pop()?.slice(0, -3); }