Skip to content

Update image URLs in metadata for consistency and absolute paths#2

Merged
upayanmazumder merged 2 commits intodevfrom
opengraph-tags
Oct 21, 2025
Merged

Update image URLs in metadata for consistency and absolute paths#2
upayanmazumder merged 2 commits intodevfrom
opengraph-tags

Conversation

@upayanmazumder
Copy link
Member

This pull request updates how Open Graph and Twitter card images are referenced in the app's metadata to ensure they use absolute URLs instead of relative paths. This change improves compatibility with social media platforms and link previews.

Metadata image URL updates:

  • Changed Open Graph and Twitter card image URLs in app/src/app/layout.tsx from the relative path /og-image.png to the absolute URL https://kargo.dscvit.com/og-image.png for both the images array and the Twitter card metadata. [1] [2]

Dynamic metadata generation improvements:

  • Updated the generatePageMetadata function in app/src/lib/metadata.ts to always produce absolute URLs for images by prepending the base URL if the image path is not already absolute. This ensures all metadata images are correctly referenced. [1] [2] [3]

@upayanmazumder upayanmazumder self-assigned this Oct 21, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates image URLs in metadata across the application to use absolute paths instead of relative paths, ensuring proper display in social media previews and link sharing. The changes introduce a helper function to dynamically construct absolute URLs and apply this pattern consistently to both static and dynamic metadata.

Key changes:

  • Modified the generatePageMetadata function to automatically convert relative image paths to absolute URLs
  • Updated static metadata in the root layout to use absolute URLs for Open Graph and Twitter card images

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/src/lib/metadata.ts Added logic to convert relative image paths to absolute URLs in the metadata generation function
app/src/app/layout.tsx Changed hardcoded image URLs from relative to absolute paths in static metadata

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@upayanmazumder upayanmazumder merged commit 75b6ea4 into dev Oct 21, 2025
1 of 3 checks passed
@upayanmazumder upayanmazumder deleted the opengraph-tags branch October 21, 2025 12:54
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.

2 participants