Comments (1)
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.
from astro-paper.
Related Issues (20)
- Issue about `Content Collections` with `astro build` command
- How do I add a `Notes` tab, similar to `Posts` HOT 1
- Frontmatter - setting "draft" to "first"
- Generate new post/article. HOT 1
- Tailwind- dark mode- Table.
- The theme v4.2.0 not working locally
- toggle-theme.js
- posts description question
- Following installation steps doesn't create Astro with template HOT 1
- Any chance of documentation on adding additional pages to menu? HOT 1
- Vercel Web Analytics don't work
- Publishing to Netlify: latest post doesn't show up. HOT 2
- Post Readtime Blog Guide leads to errors in getPostsWithRT.ts HOT 2
- Invalid Date HOT 3
- Any chance of guidance for basic CSS modifications? HOT 1
- react version conflict HOT 3
- Categories Need to add categories feature in menu HOT 3
- Cms need to connect to cms HOT 1
- Google search console how to add astro paper to it HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astro-paper.