add getRenderFunction()
This commit is contained in:
@@ -34,6 +34,12 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration {
|
|||||||
params.addPageExtension(".gmi")
|
params.addPageExtension(".gmi")
|
||||||
params.addContentEntryType({
|
params.addContentEntryType({
|
||||||
extensions: [".gmi"],
|
extensions: [".gmi"],
|
||||||
|
getRenderFunction: async (config) => {
|
||||||
|
return async (entry) => ({
|
||||||
|
html: entry.body ?? '',
|
||||||
|
frontmatter: entry.data,
|
||||||
|
});
|
||||||
|
},
|
||||||
getEntryInfo: async ({fileUrl, contents}) => {
|
getEntryInfo: async ({fileUrl, contents}) => {
|
||||||
const lines = contents.split("\n")
|
const lines = contents.split("\n")
|
||||||
let data: Record<string, unknown> = {}
|
let data: Record<string, unknown> = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user