-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[core] Add default preview url #36118
Conversation
Netlify deploy previewhttps://deploy-preview-36118--material-ui.netlify.app/ Bundle size report |
const asPathWithoutLang = router.asPath.replace(/^\/[a-zA-Z]{2}\//, '/'); | ||
let product = asPathWithoutLang.replace(/^\/([^/]+)\/.*/, '$1'); | ||
|
||
const asPathWithoutLang = router.asPath.replace(/^\/+[a-zA-Z]{2}\//, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually do this in the rest of the codebase.
const { canonicalAs } = pathnameToLanguage(router.asPath); |
if (canonicalAs.startsWith('/joy-ui/')) { |
Would it make sense to do
const asPathWithoutLang = router.asPath.replace(/^\/+[a-zA-Z]{2}\//, '/'); | |
const { canonicalAs: asPathWithoutLang } = pathnameToLanguage(router.asPath); |
And fix
const canonicalAs = userLanguage === 'en' ? pathname : pathname.substring(3);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, I will open another PR to refactor the code and add more tests.
Co-authored-by: Olivier Tassinari <[email protected]> Signed-off-by: Siriwat K <[email protected]>
Before:
Even if there is no docs change, the preview URL should show.
After: