Add a simple comment about some string wizardry

This commit is contained in:
Dave Smith-Hayes 2024-07-28 19:57:01 -04:00
parent 0a055c77dd
commit ecbfbd31de

View File

@ -13,6 +13,8 @@ export async function readPostFile(path: string): Promise<Post> {
let slug = parsedData.slug; let slug = parsedData.slug;
if (!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); slug = path.split("/").pop()?.slice(0, -3);
} }