Replies: 7 comments
-
I have some questions:
|
Beta Was this translation helpful? Give feedback.
-
There is a hacky solution where we can nest the docs collection within a second docs folder like
Yep, that's right. For the products collection, it would be I've read the post and checked the repo; it looks like if we are implementing automatic OG generation, the collection schemas should be identical across collections. I will refactor the products accordingly, so we can use getImageOptions: (_path, page: (typeof pages)[number]) => {
return {
// Use the page title and description as the image title and description.
title: page.data.title,
description: page.data.description,
// Customize various colors and add a border.
...
} from the post. |
Beta Was this translation helpful? Give feedback.
-
for og image generation, this is also a good reference https://astro-paper.pages.dev/posts/dynamic-og-image-generation-in-astropaper-blog-posts/ |
Beta Was this translation helpful? Give feedback.
-
You are right, this is the only way according to the Starlight docs: https://starlight.astro.build/manual-setup/#use-starlight-at-a-subpath
|
Beta Was this translation helpful? Give feedback.
-
@newbeelearn thanks for the references.. I'm using a similar approach in my portfolio site with @vercel/og. I followed this guide and this is the result: A bit harder to set up but much more flexible |
Beta Was this translation helpful? Give feedback.
-
i am unable to find the source code of this library https://www.npmjs.com/package/@vercel/og , it looks like it would be using vercel edge functions also refer to this vercel/og-image#226 (comment) . I am afraid this looks like a big limitation to force all the theme users to use some commercial service. It also seems to require setting up wasm, if all theme users are required to do this it would complicate the setup. |
Beta Was this translation helpful? Give feedback.
-
Well, if that's the case, I think it would be better to stick to Hideoo's implementation. We can always reference other options for users to decide which one to choose. |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on adding automatic Open Graph image generation for collection pages, inspired by the approach detailed in this post.
My progress can be seen in the branch: feat/docs-og:
I would greatly appreciate any feedback or suggestions on this implementation. If this aligns with our project goals, I'm eager to continue refining this feature.
Beta Was this translation helpful? Give feedback.
All reactions