diff options
| author | Joe Carstairs <me@joeac.net> | 2026-03-21 20:38:11 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-03-21 20:38:11 +0000 |
| commit | 5663e18f8d9780053164ea1a97cd1a52eb6745f5 (patch) | |
| tree | 56c879c1b74d1695bd61ba48cb6af691bf8e91cd /src | |
| parent | 7add0755683675019f2c540ecde7009aa3565841 (diff) | |
fixes slug bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.ts | 7 |
1 files changed, 6 insertions, 1 deletions
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, |
