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

[OG] Finish OG Image generation with updated middleware implementation #10440

Closed
2 of 4 tasks
dac09 opened this issue Apr 11, 2024 · 1 comment
Closed
2 of 4 tasks

[OG] Finish OG Image generation with updated middleware implementation #10440

dac09 opened this issue Apr 11, 2024 · 1 comment
Assignees

Comments

@dac09
Copy link
Collaborator

dac09 commented Apr 11, 2024

@cannikin and I have a plan!

  • Add original file path (Relative path from project routes) to route manifest

  • Create OG Image Vite plugin to build all *.{png,jpg}.jsx files to the dist folder.
    In vite plugin, map filepath to ogImg/AboutPage/AboutPage.mjs: this is the og image component

  • In the middleware, we match a route to the request (after ignoring the extension).
    Then we know the original file path, so we can lookup the og image component (and if it doesn't exist, 404)

  • React hooks to easily get the url

Decision points:
☐ Should playwright be a dependency? Or will it eventually be part of the setup command (or instructions)
☐ Where does ogmiddleware live?

  • @redwoodjs/og-gen?
    ☐ @redwoodjs/og-gen/middleware
    ☐ @redwoodjs/og-gen/hooks
    ☐ @redwoodjs/og-gen/plugin
@cannikin
Copy link
Member

Completed by #10469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants