From 2048c576e98acb0f1e3e26b7c75d2bc86d05ee1b Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Tue, 24 Mar 2026 21:32:20 +0000 Subject: [PATCH] trim title off body if detected --- src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 85e57db..48c140a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,7 +50,7 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { } } - const body = lines.slice(bodyStartLineIndex).join("\n") + let body = lines.slice(bodyStartLineIndex).join("\n") const filepath = fileURLToPath(fileUrl) const filename = filepath.slice(filepath.lastIndexOf("/") + 1) @@ -82,6 +82,11 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { ?.slice(14), ) + if (data["title"]) { + body.replace(`# ${data["title"]}\n`, ''); + body = body.trim(); + } + return { data, rawData: frontmatter,