diff --git a/src/components/Sidebar/Sidebar.jsx b/src/components/Sidebar/Sidebar.jsx index f555a71cf21b..735fe34a8b2f 100644 --- a/src/components/Sidebar/Sidebar.jsx +++ b/src/components/Sidebar/Sidebar.jsx @@ -13,6 +13,10 @@ import LoadingIcon from '../../styles/icons/loading.svg'; const versions = [5, 4]; const currentDocsVersion = 5; +// hide them from sidebar +// r for `redirect` +const excludedPages = ['/r/webpack/']; + Sidebar.propTypes = { className: PropTypes.string, pages: PropTypes.array, @@ -69,26 +73,28 @@ export default function Sidebar({ className = '', pages, currentPage }) { - {pages.map((page, index) => { - let displayGroup = group !== page.group && page.group !== '-'; - group = page.group; + {pages + .filter((page) => excludedPages.includes(page.url) === false) + .map((page, index) => { + let displayGroup = group !== page.group && page.group !== '-'; + group = page.group; - return ( -
- {displayGroup ? ( -

{group}

- ) : null} + return ( +
+ {displayGroup ? ( +

{group}

+ ) : null} - -
- ); - })} + +
+ ); + })} ); diff --git a/src/components/Site/Site.jsx b/src/components/Site/Site.jsx index 99d9709d26a5..b0f6c12b3703 100644 --- a/src/components/Site/Site.jsx +++ b/src/components/Site/Site.jsx @@ -149,7 +149,7 @@ function Site(props) { ); // not to show in sub navbar - const excludeItems = ['contribute', 'blog']; + const excludeItems = ['contribute', 'blog', 'r']; const title = getPageTitle(Content, location.pathname); diff --git a/src/components/Site/clientSideRedirections.js b/src/components/Site/clientSideRedirections.js index 53ba4f55d5bf..703ec65374e7 100644 --- a/src/components/Site/clientSideRedirections.js +++ b/src/components/Site/clientSideRedirections.js @@ -9,5 +9,13 @@ export default function (location) { ) { return `/configuration/cache/${location.hash}`; } + + if (location.pathname === '/r/webpack/') { + const searchParams = new URLSearchParams(location.search); + const option = searchParams.get('option') || ''; + const options = option.split('/').filter(Boolean); + if (options.length === 0) return '/configuration/'; + return `/configuration/${options[0]}/#${options.join('').toLowerCase()}`; + } return false; } diff --git a/src/content/r/webpack.mdx b/src/content/r/webpack.mdx new file mode 100644 index 000000000000..21fe81b79efc --- /dev/null +++ b/src/content/r/webpack.mdx @@ -0,0 +1,11 @@ +--- +title: '' +--- + +import { PlaceholderString } from '../../components/Placeholder/Placeholder'; + +