factors out body and slug in getEntryInfo()

This commit is contained in:
2026-03-21 20:35:45 +00:00
parent 76766d5f29
commit 18ac414a8f
+6 -2
View File
@@ -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,
};
},
})