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

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Draft

feat: add dynamic og images #342

wants to merge 13 commits into from

Conversation

deansallinen
Copy link
Contributor

No description provided.

Copy link

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

Deploying 2nicove with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a35fb6
Status: ✅  Deploy successful!
Preview URL: https://5bdde0e1.unicove2.pages.dev
Branch Preview URL: https://opengraph-images.unicove2.pages.dev

View logs

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
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.

1 participant