1
0
silverbullet/plugs/template/plug_api.ts

25 lines
525 B
TypeScript
Raw Normal View History

import type { PageMeta } from "$sb/types.ts";
import { system } from "../../plug-api/syscalls.ts";
export function renderTemplate(
templateText: string,
pageMeta: PageMeta,
data: any = {},
2023-11-13 14:49:21 +00:00
): Promise<{ frontmatter?: string; text: string }> {
return system.invokeFunction(
"template.renderTemplate",
templateText,
pageMeta,
data,
);
}
export function cleanTemplate(
templateText: string,
): Promise<string> {
return system.invokeFunction(
"template.cleanTemplate",
templateText,
);
}