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,