fixes slug bug
This commit is contained in:
+6
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user