Open Bravilogy opened 2 months ago
I think I actually found a solution, so I'll post it here just in case someone else stumbles upon the same thing. I replicated what this package does: https://github.com/ryoid/solid-satori/tree/main/packages/solid-satori
for example:
export async function renderToSvg(
component: () => JSX.Element,
options: SatoriOptions
) {
const result = await renderToStringAsync(component);
const markup = htmlToReactNode(result);
return satori(markup, options);
}
export async function generateOgImageForPost(post: CollectionEntry<"blog">) {
const svg = await renderToSvg(() => postOgImage(post), options);
return svgBufferToPngBuffer(svg);
}
And obviously updated style
props in postOgImage
and siteOgImage
to be strings.
I found a strange issue when using SolidJS with this template.
results in:
Probably a long shot, but perhaps anyone has a solution?