From 5043bb3a56fe5d5ceffdaf48dc0a171618b88fe1 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 5 Feb 2023 17:20:51 +0000 Subject: [PATCH] separate community/blog sidebars --- beta/src/pages/[[...markdownPath]].js | 12 ++++- beta/src/sidebarBlog.json | 42 ++++++++++++++++ beta/src/sidebarCommunity.json | 42 ++++++++++++++++ beta/src/sidebarLearn.json | 72 --------------------------- 4 files changed, 95 insertions(+), 73 deletions(-) create mode 100644 beta/src/sidebarBlog.json create mode 100644 beta/src/sidebarCommunity.json diff --git a/beta/src/pages/[[...markdownPath]].js b/beta/src/pages/[[...markdownPath]].js index a4e123db4..59bb2201f 100644 --- a/beta/src/pages/[[...markdownPath]].js +++ b/beta/src/pages/[[...markdownPath]].js @@ -8,6 +8,8 @@ import {MDXComponents} from 'components/MDX/MDXComponents'; import {Page} from 'components/Layout/Page'; import sidebarLearn from '../sidebarLearn.json'; import sidebarReference from '../sidebarReference.json'; +import sidebarCommunity from '../sidebarCommunity.json'; +import sidebarBlog from '../sidebarBlog.json'; export default function Layout({content, toc, meta}) { const parsedContent = useMemo( @@ -21,6 +23,12 @@ export default function Layout({content, toc, meta}) { case 'reference': routeTree = sidebarReference; break; + case 'community': + routeTree = sidebarCommunity; + break; + case 'blog': + routeTree = sidebarBlog; + break; } return ( @@ -35,8 +43,10 @@ function useActiveSection() { return 'reference'; } else if (asPath.startsWith('/learn')) { return 'learn'; + } else if (asPath.startsWith('/community')) { + return 'community'; } else if (asPath.startsWith('/blog')) { - return 'learn'; + return 'blog'; } else { return 'home'; } diff --git a/beta/src/sidebarBlog.json b/beta/src/sidebarBlog.json new file mode 100644 index 000000000..e62d5596f --- /dev/null +++ b/beta/src/sidebarBlog.json @@ -0,0 +1,42 @@ +{ + "routes": [ + { + "hasSectionHeader": true, + "sectionHeader": "Stay Informed" + }, + { + "title": "Blog", + "path": "/blog", + "routes": [ + { + "title": "React Labs: June 2022", + "path": "/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022" + }, + { + "title": "React v18.0", + "path": "/blog/2022/03/29/react-v18" + }, + { + "title": "How to Upgrade to React 18", + "path": "/blog/2022/03/08/react-18-upgrade-guide" + }, + { + "title": "React Conf 2021 Recap", + "path": "/blog/2021/12/17/react-conf-2021-recap" + }, + { + "title": "The Plan for React 18", + "path": "/blog/2021/06/08/the-plan-for-react-18" + }, + { + "title": "Introducing Server Components", + "path": "/blog/2020/12/21/data-fetching-with-react-server-components" + }, + { + "title": "Older posts", + "path": "https://reactjs.org/blog/all.html" + } + ] + } + ] +} diff --git a/beta/src/sidebarCommunity.json b/beta/src/sidebarCommunity.json new file mode 100644 index 000000000..4a607b68a --- /dev/null +++ b/beta/src/sidebarCommunity.json @@ -0,0 +1,42 @@ +{ + "routes": [ + { + "hasSectionHeader": true, + "sectionHeader": "Get Involved" + }, + { + "title": "Community", + "path": "/community", + "routes": [ + { + "title": "React Conferences", + "path": "/community/conferences" + }, + { + "title": "React Meetups", + "path": "/community/meetups" + }, + { + "title": "React Videos", + "path": "/community/videos" + }, + { + "title": "Meet the Team", + "path": "/community/team" + }, + { + "title": "Docs Contributors", + "path": "/community/docs-contributors" + }, + { + "title": "Acknowledgements", + "path": "/community/acknowledgements" + }, + { + "title": "Versioning Policy", + "path": "/community/versioning-policy" + } + ] + } + ] +} diff --git a/beta/src/sidebarLearn.json b/beta/src/sidebarLearn.json index b4734b67f..edbb3b89e 100644 --- a/beta/src/sidebarLearn.json +++ b/beta/src/sidebarLearn.json @@ -198,78 +198,6 @@ "path": "/learn/reusing-logic-with-custom-hooks" } ] - }, - { - "hasSectionHeader": true, - "sectionHeader": "About React" - }, - { - "title": "Community", - "path": "/community", - "routes": [ - { - "title": "React Conferences", - "path": "/community/conferences" - }, - { - "title": "React Meetups", - "path": "/community/meetups" - }, - { - "title": "React Videos", - "path": "/community/videos" - }, - { - "title": "Meet the Team", - "path": "/community/team" - }, - { - "title": "Docs Contributors", - "path": "/community/docs-contributors" - }, - { - "title": "Acknowledgements", - "path": "/community/acknowledgements" - }, - { - "title": "Versioning Policy", - "path": "/community/versioning-policy" - } - ] - }, - { - "title": "Blog", - "path": "/blog", - "routes": [ - { - "title": "React Labs: June 2022", - "path": "/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022" - }, - { - "title": "React v18.0", - "path": "/blog/2022/03/29/react-v18" - }, - { - "title": "How to Upgrade to React 18", - "path": "/blog/2022/03/08/react-18-upgrade-guide" - }, - { - "title": "React Conf 2021 Recap", - "path": "/blog/2021/12/17/react-conf-2021-recap" - }, - { - "title": "The Plan for React 18", - "path": "/blog/2021/06/08/the-plan-for-react-18" - }, - { - "title": "Introducing Server Components", - "path": "/blog/2020/12/21/data-fetching-with-react-server-components" - }, - { - "title": "Older posts", - "path": "https://reactjs.org/blog/all.html" - } - ] } ] }