From 18ac414a8f89f0c5937d27758858ca2a7ad8e418 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 21 Mar 2026 20:35:45 +0000 Subject: [PATCH] factors out body and slug in getEntryInfo() --- src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f5e0d9b..fc5848e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,11 +48,15 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { } catch { } } + const body = lines.slice(bodyStartLineIndex).join('\n'); + + const slug = typeof data['slug'] === 'string' ? data['slug'] : fileUrl.pathname; + return { data, rawData: frontmatter, - body: lines.slice(bodyStartLineIndex).join('\n'), - slug: typeof data['slug'] === 'string' ? data['slug'] : fileUrl.pathname, + body, + slug, }; }, })