Skip to content

[docs] Fix broken social preview image on shared docs links#23055

Open
sai6855 wants to merge 1 commit into
mui:masterfrom
sai6855:charts-og
Open

[docs] Fix broken social preview image on shared docs links#23055
sai6855 wants to merge 1 commit into
mui:masterfrom
sai6855:charts-og

Conversation

@sai6855

@sai6855 sai6855 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Added hostUrl: 'https://mui.com' to DOCS_CONFIG in docs/pages/_app.tsx to specify the absolute origin for canonical and social-preview URLs (og:url, og:image).

Before and after

Screenshot_20260704_002419_WhatsApp

@code-infra-dashboard

code-infra-dashboard Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-23055--material-ui-x.netlify.app/
QR code for https://deploy-preview-23055--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 0B(0.00%) 0B(0.00%)
@mui/x-scheduler-premium 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


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
@sai6855 sai6855 added type: bug It doesn't behave as expected. docs Improvements or additions to the documentation. labels Jul 3, 2026
@sai6855 sai6855 requested a review from Copilot July 3, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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' to DOCS_CONFIG in 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.

@sai6855 sai6855 marked this pull request as ready for review July 4, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants