-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: dynamic OG images for docs #986 #1291
Conversation
Need to tweak it to make it look nicer, doing this for testing quick
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey t3-oss/translators! This PR contains changes to your language. Please review the changes ❤️. OG.TS: |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://create-t3-app-git-fork-iaverages-next-t3-oss.vercel.app/ |
Enabling SSR with Astro means, by default, every page will be server-side rendered. Currently, when SSR is enabled prerendering pages (static page generation) is set to false for every page, with an opt-in variable On Astro's roadmap, they have plans to change the default to allow for prerendering by default, with opt-in for SSR. withastro/roadmap#539 If you guys do not want SSR then it would be best to wait for the Astro team to release the opt-in SSR per page. |
what actually changed I will never know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OG images look really good now!
Would be nice to have a lil playground to be able to preview / modify them in dev. But IMO ok to merge this without, and open an issue to add it.
Glad you like them :) Did you see my previous comment about the issues around enabling SSR with Astro? Is the sitemap something that is important to you guys? The sitemap plugin cannot automatically generate the sitemap for SSR routes and due to how the server output mode works, all routes are SSR routes by default. Just want to confirm since no one has responded about it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, somehow missed this in my notifications
re SSR/sitemaps: let's solve that when we get to it :)
* Prepare for OG image generation * Setup basic og image generation Need to tweak it to make it look nicer, doing this for testing quick * Dont optimize @resvg/resvg-js * Include protocol in URL for OG * Use OG route for OG images in docs * Use vercel URL for og images in meta * Cache OG responses * Changes to fetching fonts * Final OG image design * Make util for site url * Setup env for satori debug * -p doesnt include untracked files ._. * Delete unneeded assets * Make file name consistent * design 2 * Design 3 * Setup OG to use reading time + path route * Fix url on og image * Fix reading time * Use Astro site hostname * Add fonts for other languages (ar, zh-hans) * Fix linting issues * fix env debug mode * Add support for RTL languages in OG images * Remove unneeded not null assertion * Remove reading time After giving it some more thought, having a reading time doesn't make sense for docs, a blog sure but not docs. * Fix overflowing issue with long titles * Make title font smaller for larger text * Remove unused dep * Remove unused Frontmatter prop * Add reference to original place for og fonts code * Format astro config what actually changed I will never know. * Fix broken lock file * Actually fix lock file? * Remove unused reading time parameter * Use existing rtl language map --------- Co-authored-by: Christopher Ehrlich <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
Adds dynamic OG images for documentation.
Closes #986
✅ Checklist
Changelog
Screenshots
English:
![home](https://user-images.githubusercontent.com/31937542/227748565-8e5d5bcf-3d6e-407d-b764-dea195a1948e.png)
![intro](https://user-images.githubusercontent.com/31937542/227748573-e4ff5c48-3e0d-49eb-8d62-84697e2e4bce.png)
![image](https://user-images.githubusercontent.com/31937542/227748616-9f286749-6d28-429c-9bcf-462ea52e8e37.png)
![image](https://user-images.githubusercontent.com/31937542/227748624-489b3d8e-5533-4bde-954a-e3f01103bd16.png)
Large title (Title font gets reduced to avoid overflow and word breaking)
![image](https://user-images.githubusercontent.com/31937542/227748593-8630456f-889a-4215-a575-17cd463ea984.png)
Other LFR Languages:
![spanish](https://user-images.githubusercontent.com/31937542/227748678-93d1fc36-11be-43d9-b811-a17e483cedb5.png)
![french](https://user-images.githubusercontent.com/31937542/227748691-33c22161-203b-45b1-91b7-5f7af1146767.png)
![pt](https://user-images.githubusercontent.com/31937542/227748711-c6becb43-e845-4bfd-8e0f-d4a73250385e.png)
![russian](https://user-images.githubusercontent.com/31937542/227748725-7d6a229b-8b10-4763-ab41-cd2dc5431d64.png)
RTL Languages:
![image](https://user-images.githubusercontent.com/31937542/227748652-eacfdf83-520e-460d-8293-1832b989afea.png)
![image](https://user-images.githubusercontent.com/31937542/227748663-4bf377ee-f8ab-4308-be60-58a777494dbf.png)
![image](https://user-images.githubusercontent.com/31937542/227748673-41216e66-dce0-4519-8e99-90f47e8a9bef.png)
💯