Skip to content

Commit 8333b6d

Browse files
author
harish-sethuraman
authored
Fixes wrong breadcrumb for 404 page (#4074)
* Fixes wrong breadcrumb for 404 page * Change Home as default layout * Add layout Learn to the pages inside learn
1 parent 29fbe65 commit 8333b6d

37 files changed

+41
-1
lines changed

beta/plugins/md-layout-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const fm = require('gray-matter');
1515
module.exports = async function (src) {
1616
const callback = this.async();
1717
const {content, data} = fm(src);
18-
const layout = data.layout || 'Learn';
18+
const layout = data.layout || 'Home';
1919
const code =
2020
`import withLayout from 'components/Layout/Layout${layout}';
2121

beta/src/components/Layout/useRouteMeta.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export function useRouteMeta(rootRoute?: RouteItem) {
5656
const routeTree = rootRoute || sidebarContext;
5757
const router = useRouter();
5858
const cleanedPath = router.pathname;
59+
if (cleanedPath === '/404') {
60+
return {
61+
breadcrumbs: [],
62+
};
63+
}
5964
const breadcrumbs = getBreadcrumbs(cleanedPath, routeTree);
6065
return {
6166
...getRouteMeta(cleanedPath, routeTree),

beta/src/pages/learn/add-react-to-a-website.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Add React to a Website
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/adding-interactivity.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Adding Interactivity
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/choosing-the-state-structure.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Choosing the State Structure
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/conditional-rendering.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Conditional Rendering
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/describing-the-ui.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Describing the UI
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/editor-setup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Editor Setup
3+
layout: Learn
34
---
45

56
<Intro>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Escape Hatches
3+
layout: Learn
34
---
45

56
This chapter is incomplete and is still being written!

beta/src/pages/learn/extracting-state-logic-into-a-reducer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Extracting State Logic into a Reducer
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/importing-and-exporting-components.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Importing and Exporting Components
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Quick Start
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/installation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Installation
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/javascript-in-jsx-with-curly-braces.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: JavaScript in JSX with Curly Braces
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/keeping-components-pure.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Keeping Components Pure
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/managing-state.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Managing State
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/manipulating-the-dom-with-refs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: 'Manipulating the DOM with Refs'
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/passing-data-deeply-with-context.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Passing Data Deeply with Context
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/passing-props-to-a-component.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Passing Props to a Component
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/preserving-and-resetting-state.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Preserving and Resetting State
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/queueing-a-series-of-state-updates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Queueing a Series of State Updates
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/react-developer-tools.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React Developer Tools
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/reacting-to-input-with-state.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Reacting to Input with State
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/referencing-values-with-refs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: 'Referencing Values with Refs'
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/render-and-commit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Render and Commit
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/rendering-lists.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Rendering Lists
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/responding-to-events.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Responding to Events
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/scaling-up-with-reducer-and-context.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Scaling Up with Reducer and Context
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/sharing-state-between-components.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Sharing State Between Components
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/start-a-new-react-project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Start a New React Project
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/state-a-components-memory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "State: A Component's Memory"
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/state-as-a-snapshot.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: State as a Snapshot
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/thinking-in-react.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Thinking in React
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/updating-arrays-in-state.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Updating Arrays in State
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/updating-objects-in-state.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Updating Objects in State
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/writing-markup-with-jsx.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Writing Markup with JSX
3+
layout: Learn
34
---
45

56
<Intro>

beta/src/pages/learn/your-first-component.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Your First Component
3+
layout: Learn
34
---
45

56
<Intro>

0 commit comments

Comments
 (0)