Skip to content
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

Merged
merged 43 commits into from
Apr 24, 2023
Merged

feat: dynamic OG images for docs #986 #1291

merged 43 commits into from
Apr 24, 2023

Conversation

iAverages
Copy link
Contributor

@iAverages iAverages commented Mar 22, 2023

Adds dynamic OG images for documentation.

Closes #986

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

  • Setup Astro for server builds
  • Setup route for generating dynamic images using Satori

Screenshots

English:
home
intro
image
image

Large title (Title font gets reduced to avoid overflow and word breaking)
image

Other LFR Languages:
spanish
french
pt
russian

RTL Languages:
image
image
image

💯

Need to tweak it to make it look nicer, doing this for testing quick
@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2023

⚠️ No Changeset found

Latest commit: 6988edb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-t3-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2023 5:33am

@github-actions github-actions bot added the 📚 documentation Improvements or additions to documentation label Mar 22, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2023

Hey t3-oss/translators!

This PR contains changes to your language. Please review the changes ❤️.

OG.TS:

@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 96
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://create-t3-app-git-fork-iaverages-next-t3-oss.vercel.app/

@iAverages
Copy link
Contributor Author

OG generation is working. I need to change the design of the OG images themselves. I plan to make the title bold and play around with the sizing + logo color. If anyone has any ideas on what we can use please share!

The red boxes are apart of debug mode in satori
OG Example

@iAverages
Copy link
Contributor Author

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 export const prerender = true. Using SSR also means the automatic sitemap generation does not work.

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.
Copy link
Member

@c-ehrlich c-ehrlich left a 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.

www/src/config.ts Outdated Show resolved Hide resolved
@iAverages
Copy link
Contributor Author

iAverages commented Apr 6, 2023

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

Copy link
Member

@c-ehrlich c-ehrlich left a 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 :)

@juliusmarminge juliusmarminge disabled auto-merge April 24, 2023 05:32
@juliusmarminge juliusmarminge added this pull request to the merge queue Apr 24, 2023
Merged via the queue into t3-oss:next with commit e5f2f73 Apr 24, 2023
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app-deprecated that referenced this pull request Jun 9, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(docs): dynamic og-images
4 participants