[docs] Fix broken social preview image on shared docs links#23055
Open
sai6855 wants to merge 1 commit into
Open
[docs] Fix broken social preview image on shared docs links#23055sai6855 wants to merge 1 commit into
sai6855 wants to merge 1 commit into
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
The docs `AppLayoutHead` builds `og:url`, `og:image`, and `twitter:image` by interpolating `hostUrl` from the docs config. `DOCS_CONFIG` spread `DEFAULT_DOCS_CONFIG` without setting `hostUrl`, so the value was `undefined` and every social meta tag resolved to `undefined/edge-functions/og-image?...`, which social platforms could not load. Set `hostUrl` to `https://mui.com`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012auoswyk6M4Ji3R5y4U8U3
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MUI X documentation app configuration to ensure canonical and social preview meta URLs (notably og:url and og:image) are generated with an absolute origin, preventing broken previews when docs links are shared.
Changes:
- Add
hostUrl: 'https://mui.com'toDOCS_CONFIGin the docs custom app to set an explicit absolute origin for URL generation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
hostUrl: 'https://mui.com'toDOCS_CONFIGindocs/pages/_app.tsxto specify the absolute origin for canonical and social-preview URLs (og:url, og:image).Before and after