You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using TanStack Start with Fumadocs and would like to prerender og:image.
My first attempt was to add a hidden <a herf="/api/og/key" /> to the page route so the prerenderer scrawler would generate it, but I realized it only processes text/html responses.
I also considered generating the images from onSuccess hook, but it doesn't seem like a great fit with the Fumadocs vite plugin and i don't have access to the prerender server either.
Would supporting non-HTML responses (e.g. image/png) be within the scope of the prerender plugin? Since these routes are deterministic, it seems like they could be generated alongside HTML pages.
I'm happy to help implement this once there's agreement on the design.
Alternative Approach for OG Image Prerendering in FurmaDocs
Manual Path Discovery
Parse the content folder to identify documentation pages. Derive OG image paths for each page.
Configuration with createOgPrerenderPages
Convert paths into prerender configuration objects. Disable crawlLinks and inject the x-og-prerender: base64 header.
Header-Based Encoding Strategy
In the OG handler, check for the x-og-prerender: base64 header. Convert the ImageResponse buffer to a base64-encoded string if the header is set.
Binary Persistence via onSuccess Hook
Decode base64 string back to binary buffer. Write binary buffer to the filesystem as a PNG file.
The inconvenients of this approach are:
Inability to Use Crawling for OG Generation: The system does not support automatic link crawling for generating Open Graph (OG) images. Instead, it requires explicit path discovery.
Double Transformation: To accommodate the text-oriented prerender system, the approach involves a double transformation process. First, binary image data is encoded to a base64 string. Then, the base64 string is decoded back to binary image data for persistence on the filesystem. This double transformation adds complexity to the process.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! 👋
I'm using TanStack Start with Fumadocs and would like to prerender og:image.
My first attempt was to add a hidden
<a herf="/api/og/key" />to the page route so the prerenderer scrawler would generate it, but I realized it only processes text/html responses.I also considered generating the images from onSuccess hook, but it doesn't seem like a great fit with the Fumadocs vite plugin and i don't have access to the prerender server either.
Would supporting non-HTML responses (e.g. image/png) be within the scope of the prerender plugin? Since these routes are deterministic, it seems like they could be generated alongside HTML pages.
I'm happy to help implement this once there's agreement on the design.
All reactions