add getRenderFunction()

This commit is contained in:
2026-03-21 20:50:17 +00:00
parent c3c710107d
commit 237990619e
+6
View File
@@ -34,6 +34,12 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration {
params.addPageExtension(".gmi")
params.addContentEntryType({
extensions: [".gmi"],
getRenderFunction: async (config) => {
return async (entry) => ({
html: entry.body ?? '',
frontmatter: entry.data,
});
},
getEntryInfo: async ({fileUrl, contents}) => {
const lines = contents.split("\n")
let data: Record<string, unknown> = {}