From 462a56744e2e91c88c3e8b55bb6bb1f38de5d9f1 Mon Sep 17 00:00:00 2001 From: danilo leal Date: Fri, 11 Mar 2022 16:39:10 -0300 Subject: [PATCH 1/2] fix source code links --- .../getting-started/templates/Templates.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/data/material/getting-started/templates/Templates.js b/docs/data/material/getting-started/templates/Templates.js index d7d8f33d77f88c..6d0728ed487544 100644 --- a/docs/data/material/getting-started/templates/Templates.js +++ b/docs/data/material/getting-started/templates/Templates.js @@ -17,7 +17,7 @@ function layouts(t) { href: '/getting-started/templates/dashboard/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/dashboard', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/dashboard', }, { title: t('signInTitle'), @@ -26,7 +26,7 @@ function layouts(t) { href: '/getting-started/templates/sign-in/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/sign-in', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-in', }, { title: t('signInSideTitle'), @@ -35,7 +35,7 @@ function layouts(t) { href: '/getting-started/templates/sign-in-side/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/sign-in-side', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-in-side', }, { title: t('signUpTitle'), @@ -44,7 +44,7 @@ function layouts(t) { href: '/getting-started/templates/sign-up/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/sign-up', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-up', }, { title: t('blogTitle'), @@ -53,7 +53,7 @@ function layouts(t) { href: '/getting-started/templates/blog/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/blog', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/blog', }, { title: t('checkoutTitle'), @@ -62,7 +62,7 @@ function layouts(t) { href: '/getting-started/templates/checkout/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/checkout', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/checkout', }, { title: t('albumTitle'), @@ -71,7 +71,7 @@ function layouts(t) { href: '/getting-started/templates/album/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/album', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/album', }, { title: t('pricingTitle'), @@ -80,7 +80,7 @@ function layouts(t) { href: '/getting-started/templates/pricing/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/pricing', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/pricing', }, { title: t('stickyFooterTitle'), @@ -89,7 +89,7 @@ function layouts(t) { href: '/getting-started/templates/sticky-footer/', source: // #default-branch-switch - 'https://github.com/mui/material-ui/tree/master/docs/data/material/getting-started/templates/sticky-footer', + 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sticky-footer', }, ]; } From 24622d7608f0001a96b18533b1fad8c73dbb5e7a Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 12 Mar 2022 13:35:06 +0100 Subject: [PATCH 2/2] fix the root problem --- .../getting-started/templates/Templates.js | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/docs/data/material/getting-started/templates/Templates.js b/docs/data/material/getting-started/templates/Templates.js index 6d0728ed487544..0b84e13a1e367d 100644 --- a/docs/data/material/getting-started/templates/Templates.js +++ b/docs/data/material/getting-started/templates/Templates.js @@ -8,6 +8,8 @@ import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; import { useTranslate } from 'docs/src/modules/utils/i18n'; +const sourcePrefix = `${process.env.SOURCE_CODE_REPO}/tree/v${process.env.LIB_VERSION}`; + function layouts(t) { return [ { @@ -15,81 +17,63 @@ function layouts(t) { description: t('dashboardDescr'), src: '/static/images/templates/dashboard.png', href: '/getting-started/templates/dashboard/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/dashboard', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/dashboard`, }, { title: t('signInTitle'), description: t('signInDescr'), src: '/static/images/templates/sign-in.png', href: '/getting-started/templates/sign-in/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-in', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/sign-in`, }, { title: t('signInSideTitle'), description: t('signInSideDescr'), src: '/static/images/templates/sign-in-side.png', href: '/getting-started/templates/sign-in-side/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-in-side', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/sign-in-side`, }, { title: t('signUpTitle'), description: t('signUpDescr'), src: '/static/images/templates/sign-up.png', href: '/getting-started/templates/sign-up/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sign-up', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/sign-up`, }, { title: t('blogTitle'), description: t('blogDescr'), src: '/static/images/templates/blog.png', href: '/getting-started/templates/blog/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/blog', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/blog`, }, { title: t('checkoutTitle'), description: t('checkoutDescr'), src: '/static/images/templates/checkout.png', href: '/getting-started/templates/checkout/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/checkout', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/checkout`, }, { title: t('albumTitle'), description: t('albumDescr'), src: '/static/images/templates/album.png', href: '/getting-started/templates/album/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/album', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/album`, }, { title: t('pricingTitle'), description: t('pricingDescr'), src: '/static/images/templates/pricing.png', href: '/getting-started/templates/pricing/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/pricing', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/pricing`, }, { title: t('stickyFooterTitle'), description: t('stickyFooterDescr'), src: '/static/images/templates/sticky-footer.png', href: '/getting-started/templates/sticky-footer/', - source: - // #default-branch-switch - 'https://github.com/mui/material-ui/tree/v4.x/docs/src/pages/getting-started/templates/sticky-footer', + source: `${sourcePrefix}/docs/data/material/getting-started/templates/sticky-footer`, }, ]; }