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

Update Open Graph Image URL to Absolute Path for Compatibility #7802

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

sanjaiyan-dev
Copy link
Contributor

Ref-: #7789

Making the Open Graph image a full path URL (/assets/og-image.png to https://crates.io/assets/og-image.png). This change ensures that the Open Graph image works as expected, as Open Graph only supports absolute file paths.

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

while I can't seem to find any official documentation about this, there are enough tickets on various issue trackers that claim that relative URLs are not working on some platforms. since I don't see a downside in switching this to an absolute URL I guess we can merge this :)

small caveat: our staging environment will now point to the og:image of the production environment, but that seems like a small price to pay and not really an issue with static images anyway.

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-frontend 🐹 labels Dec 25, 2023
@Turbo87 Turbo87 merged commit 5e21f46 into rust-lang:main Dec 25, 2023
7 checks passed
@sanjaiyan-dev sanjaiyan-dev deleted the sanjaiyan-socialmedia-seo branch December 25, 2023 09:00
@sanjaiyan-dev
Copy link
Contributor Author

while I can't seem to find any official documentation about this, there are enough tickets on various issue trackers that claim that relative URLs are not working on some platforms. since I don't see a downside in switching this to an absolute URL I guess we can merge this :)

small caveat: our staging environment will now point to the og:image of the production environment, but that seems like a small price to pay and not really an issue with static images anyway.

Thanks for merging the pull request 🤝

https://ogp.me/#structured

@Turbo87
Copy link
Member

Turbo87 commented Dec 25, 2023

https://ogp.me/#structured

that says nothing about relative/absolute URLs though

@sanjaiyan-dev
Copy link
Contributor Author

https://ogp.me/#structured

that says nothing about relative/absolute URLs though

Unfortunately, yes. As far as I know, only absolute paths work correctly on most social media platforms, such as WhatsApp and Instagram.

@sanjaiyan-dev
Copy link
Contributor Author

sanjaiyan-dev commented Dec 28, 2023

vercel/next.js#59985 🤞🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants