From 5663e18f8d9780053164ea1a97cd1a52eb6745f5 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 21 Mar 2026 20:38:11 +0000 Subject: [PATCH] fixes slug bug --- src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 9f52617..83ffc75 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,7 +52,12 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { const body = lines.slice(bodyStartLineIndex).join('\n'); - const slug = typeof data['slug'] === 'string' ? data['slug'] : fileUrl.pathname; + const slug = + typeof data["slug"] === "string" ? + data["slug"] + : fileURLToPath(fileUrl).slice( + fileURLToPath(fileUrl).lastIndexOf("/") + 1, + ) return { data,