Skip to content

Commit 29c1d11

Browse files
committed
Update router
1 parent 025bb0a commit 29c1d11

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

‎vix-site/src/router/index.js‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import LearnPage from "../pages/LearnPage.vue";
44
import BlogPage from "../pages/BlogPage.vue";
55
import BlogPostPage from "../pages/BlogPostPage.vue";
66
import NotFoundPage from "../pages/NotFoundPage.vue";
7-
import DocsPage from "../pages/DocsPage.vue";
87

98
export const routes = [
109
{
@@ -17,7 +16,6 @@ export const routes = [
1716
name: "learn",
1817
component: LearnPage,
1918
},
20-
2119
{
2220
path: "/community",
2321
name: "community",
@@ -33,11 +31,20 @@ export const routes = [
3331
name: "blog-post",
3432
component: BlogPostPage,
3533
},
36-
// {
37-
// path: "/docs/:pathMatch(.*)*",
38-
// name: "docs",
39-
// component: DocsPage,
40-
// },
34+
35+
{
36+
path: "/docs/:pathMatch(.*)*",
37+
name: "docs",
38+
beforeEnter: (to) => {
39+
const path = to.params.pathMatch;
40+
41+
const suffix = Array.isArray(path) ? path.join("/") : path || "";
42+
43+
window.location.href = `https://docs.vixcpp.com/${suffix}`;
44+
45+
return false;
46+
},
47+
},
4148

4249
{
4350
path: "/:pathMatch(.*)*",

0 commit comments

Comments
 (0)