diff --git a/www/gatsby-node.js b/www/gatsby-node.js index 7b5171f906f65..1dd5e997c5844 100644 --- a/www/gatsby-node.js +++ b/www/gatsby-node.js @@ -34,6 +34,12 @@ exports.createPages = ({ graphql, boundActionCreators }) => { isPermanent: true, }) + createRedirect({ + fromPath: `/packages/`, // Moved "Plugins" page from /packages to /plugins + toPath: `/plugins/`, + isPermanent: true, + }) + return new Promise((resolve, reject) => { const docsTemplate = path.resolve(`src/templates/template-docs-markdown.js`) const blogPostTemplate = path.resolve(`src/templates/template-blog-post.js`) diff --git a/www/src/components/navigation-mobile.js b/www/src/components/navigation-mobile.js index 9140644af5432..39944104ad987 100644 --- a/www/src/components/navigation-mobile.js +++ b/www/src/components/navigation-mobile.js @@ -52,7 +52,7 @@ const MobileNavigation = () => ( > - + ) diff --git a/www/src/components/navigation.js b/www/src/components/navigation.js index 0c272b3f5f657..61a4bc2ed159e 100644 --- a/www/src/components/navigation.js +++ b/www/src/components/navigation.js @@ -152,7 +152,7 @@ export default ({ pathname }) => { > Docs Tutorial - Plugins + Plugins Features Blog diff --git a/www/src/layouts/index.js b/www/src/layouts/index.js index cf820299311c9..0902fdca7c97e 100644 --- a/www/src/layouts/index.js +++ b/www/src/layouts/index.js @@ -31,18 +31,20 @@ class DefaultLayout extends React.Component { const isTutorial = this.props.location.pathname.slice(0, 10) === `/tutorial/` const isFeature = this.props.location.pathname.slice(0, 9) === `/features` - const isPackage = this.props.location.pathname.slice(0, 9) === `/packages` + const isPackageSearchPage = + this.props.location.pathname.slice(0, 8) === `/plugins` || + this.props.location.pathname.slice(0, 9) === `/packages` const isPackageReadme = this.props.location.pathname.slice(0, 16) === `/packages/gatsby` const hasSidebar = - isDoc || isTutorial || isFeature || isPackage || isPackageReadme + isDoc || isTutorial || isFeature || isPackageSearchPage || isPackageReadme const isSearchSource = hasSidebar || isBlog const packageSidebarWidth = rhythm(17) const leftPadding = rhythmSize => { - if (this.props.location.pathname.slice(0, 9) === `/packages`) { + if (isPackageReadme || isPackageSearchPage) { return packageSidebarWidth } else if (hasSidebar) { return rhythm(rhythmSize) @@ -83,11 +85,11 @@ class DefaultLayout extends React.Component { let searchBarDisplayProperty let childrenMobileDisplay let childrenTabletDisplay - if (isPackage && !isPackageReadme) { + if (isPackageSearchPage && !isPackageReadme) { searchBarDisplayProperty = { display: `block` } childrenMobileDisplay = { display: `none` } childrenTabletDisplay = { display: `block` } - } else if (isPackage && isPackageReadme) { + } else if (isPackageSearchPage && isPackageReadme) { searchBarDisplayProperty = { [presets.Mobile]: { display: `none`, @@ -155,9 +157,9 @@ class DefaultLayout extends React.Component { css={{ ...searchbarStyles, [presets.Tablet]: { - display: isPackage + display: isPackageSearchPage ? `block` - : isPackage && isPackageReadme ? `block` : `none`, + : isPackageSearchPage && isPackageReadme ? `block` : `none`, width: packageSidebarWidth, position: `fixed`, background: colors.ui.whisper, diff --git a/www/src/pages/packages.js b/www/src/pages/plugins.js similarity index 100% rename from www/src/pages/packages.js rename to www/src/pages/plugins.js