fixes slug bug

This commit is contained in:
2026-03-21 20:38:11 +00:00
parent 7add075568
commit 5663e18f8d
+6 -1
View File
@@ -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,