Skip to content

Conversation

@pondorasti
Copy link
Contributor

@pondorasti pondorasti commented Dec 4, 2025

see #1615, closes mui/mui-public#561

Continuation of #3388:

  • configured meta og:url tags for all pages
  • collocated metadataBase to the root layout
CleanShot 2025-12-04 at 11 58 04@2x

@pondorasti pondorasti changed the title feat: og url tag feat: og:url tag Dec 4, 2025
@pondorasti pondorasti marked this pull request as ready for review December 4, 2025 10:59
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 4, 2025

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/react@3415
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui-components/utils@3415
    

commit: c26fc95

@mui-bot
Copy link

mui-bot commented Dec 4, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 3f39a76
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6931694d8ffc8000088db117
😎 Deploy Preview https://deploy-preview-3415--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit c26fc95
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6931696ccfccaf00085b8e7a
😎 Deploy Preview https://deploy-preview-3415--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@LukasTy LukasTy changed the title feat: og:url tag [docs-infra] Add og:url tag Dec 4, 2025
@LukasTy LukasTy added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Dec 4, 2025
);
}

export const metadata: Metadata = {
Copy link
Member

Choose a reason for hiding this comment

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

Why move this? @pondorasti

Copy link
Member

Choose a reason for hiding this comment

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

So those settings would apply to both public and private (experiments) pages.

Copy link
Member

Choose a reason for hiding this comment

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

Does it matter if it's private? #3416

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't, but it already has the other og: attributes.
Do you see any problem with the colocation of the config?

Copy link
Member

Choose a reason for hiding this comment

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

Nope just wondering ~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why move this? @pondorasti

Just cleaning up the code a bit. imo, it's much easier to follow things around when metadata configuration is collocated in one file and there's no layout inheritance at play.

I would only keep the metadata from /(public)/layout only if it has a functional role.

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

LGTM. 👍
However, are we good with the fact, that og:url will always point to the production link, even though we might be on a PR deployed docs version.
Would using a current domain be possible and make more sense?
WDYT @mui/infra?

@pondorasti
Copy link
Contributor Author

Would using a current domain be possible and make more sense?

It's likely possible, but I'm not so sure what some of the benefits would be.

I guess it comes down to meta tag testing, i.e. if you want to test opengraph previews and make them point back to the netlify preview url.

};

export const metadata: Metadata = {
metadataBase: new URL('https://base-ui.com'),
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have process.env. SITE_DEPLOY_URL that'll have the correct value based on the environment. Don't need to hard code.

Copy link
Member

@Janpot Janpot Dec 4, 2025

Choose a reason for hiding this comment

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

I don't think SITE_DEPLOY_URL would suffice as I believe it contains https://master--base-ui.netlify.app/ on production deploys. I think the desired behavior would be

  1. production: base-ui.com = URL
  2. PRs: deploy-preview-<pr-number>--base-ui.netlify.app = DEPLOY_PRIME_URL
  3. legacy: v1.base-ui.com = ? (currently not necessary yet for base, but it is for core and X)

I believe we should encode this in withDeploymentConfig() function in infra. We can base it off of the method used by llms.txt generation:

const NETLIFY_DEPLOYMENT_URL =
  process.env.PULL_REQUEST === 'true' ? process.env.DEPLOY_PRIME_URL : process.env.URL;

We should just add an optional variable in the mix for legacy deployments, e.g.

// whatever we know from Netlify
const NETLIFY_DEPLOYMENT_URL =
  process.env.PULL_REQUEST === 'true' ? process.env.DEPLOY_PRIME_URL : process.env.URL;
// optional override from DEPLOYMENT_URL variable
const DEPLOYMENT_URL = process.env.DEPLOYMENT_URL || NETLIFY_DEPLOYMENT_URL;

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Jan, I think this makes the most sense. 👍
If we ever need subdomains, it should also cover this use case the best. 🤔
@pondorasti, could you update the solution to use the suggested URL resolution method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs-infra] Missing og tags in base-ui.com

6 participants