Skip to content

Commit e2bc3a2

Browse files
committed
Prevent showning 404 and redirect to docs default-page.
1 parent 2eff7fd commit e2bc3a2

3 files changed

Lines changed: 17 additions & 24 deletions

File tree

src/app/root/root-routing.module.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,18 @@ import * as fromShared from "../shared";
66
import * as fromContainers from "./containers";
77

88
const routes: Routes = [
9-
{
10-
path: "",
11-
redirectTo: "docs",
12-
pathMatch: "full"
13-
},
149
{
1510
path: "docs",
1611
component: fromContainers.LayoutComponent,
1712
children: [
18-
{
19-
path: "",
20-
pathMatch: "full",
21-
redirectTo: "v1.0.0"
22-
},
2313
{
2414
path: "v1.0.0",
2515
loadChildren: () => import("../version1.0.0").then(m => m.Version100Module)
16+
},
17+
{
18+
path: "**",
19+
pathMatch: "full",
20+
redirectTo: "v1.0.0"
2621
}
2722
]
2823
},
@@ -40,7 +35,12 @@ const routes: Routes = [
4035
redirectTo: ""
4136
},
4237
]
43-
}
38+
},
39+
{
40+
path: "**",
41+
pathMatch: "full",
42+
redirectTo: "docs"
43+
},
4444
];
4545

4646
@NgModule({

src/app/version1.0.0/version1.0.0-routing.module.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ const routes: Routes = [
99
path: "",
1010
component: fromContainers.MainComponent,
1111
children: [
12-
13-
{
14-
path: "",
15-
pathMatch: "full",
16-
redirectTo: "getting-started"
17-
},
1812
{
1913
path: "getting-started",
2014
component: fromComponents.GettingStartedComponent
@@ -221,6 +215,12 @@ const routes: Routes = [
221215
path: "contributors",
222216
component: fromComponents.ContributorsComponent
223217
},
218+
219+
{
220+
path: "**",
221+
pathMatch: "full",
222+
redirectTo: "getting-started"
223+
}
224224
]
225225
}
226226
];

src/styles/components/_doc-navigator.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,3 @@
3232
}
3333
}
3434
}
35-
36-
@include screen-min-md {
37-
.doc-prev-next {
38-
/* 100% of parent - section-nav-width - 4rem for margins & paddings */
39-
max-width: calc(100% - #{$section-nav-width});
40-
}
41-
}

0 commit comments

Comments
 (0)