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: add dynamic og images #342

Merged
merged 16 commits into from
Feb 4, 2025
Merged

feat: add dynamic og images #342

merged 16 commits into from
Feb 4, 2025

Conversation

deansallinen
Copy link
Contributor

@deansallinen deansallinen commented Jan 22, 2025

Uses the image generator api to take translated strings and create opengraph images

Copy link

cloudflare-workers-and-pages bot commented Jan 24, 2025

Deploying 2nicove with  Cloudflare Pages  Cloudflare Pages

Latest commit: f3ee5af
Status:⚡️  Build in progress...

View logs

@deansallinen deansallinen force-pushed the opengraph-images branch 2 times, most recently from de43b9d to 017e46c Compare January 30, 2025 23:30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEO component moved one layer deeper to prevent any issues with paraglide

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata is being generated one layer deeper now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page was never accessible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generating metadata server-side, though I'm not sure if this is strictly required now that an api route handles the opengraph image

@@ -0,0 +1,15 @@
import { API_OPENGRAPH_GENERATOR } from '$env/static/private';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url for generating the open graph images

export const GET: RequestHandler = async ({ url, fetch, params }) => {
const route = params.route as keyof typeof captions;
const lang = i18n.getLanguageFromUrl(url);
const text = captions[route] || captions.default;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses only text that exists in the captions table, either the route specific description or the default. Users cannot generate their own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings page was condensed into one file

@deansallinen deansallinen requested a review from aaroncox January 30, 2025 23:39
@deansallinen deansallinen changed the title feat: add default og image feat: add dynamic og images Jan 30, 2025
@deansallinen deansallinen linked an issue Feb 3, 2025 that may be closed by this pull request
@deansallinen deansallinen marked this pull request as ready for review February 4, 2025 20:09
@aaroncox aaroncox merged commit 2d61ee0 into dev Feb 4, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add open graph image to SEO config
2 participants