Skip to content

Commit df82440

Browse files
committed
Update routing and styling
1 parent d8a210f commit df82440

File tree

4 files changed

+15
-66
lines changed

4 files changed

+15
-66
lines changed

docs/introduction/about.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: What is CodeRabbit?
44
sidebar_label: What is CodeRabbit?
55
description: Accelerate Code Reviews with AI
66
image: "/preview_meta.jpg"
7+
slug: "/"
78
---
89

910
<head>

docusaurus.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const config: Config = {
7171
docs: {
7272
sidebarPath: "./sidebars.ts",
7373
// path: "./docs",
74-
routeBasePath: "/docs",
74+
routeBasePath: "/",
7575
breadcrumbs: false,
7676
},
7777
blog: {

src/pages/index.module.css

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
*/
55

66
.heroBanner {
7-
padding: 4rem 0;
8-
text-align: center;
9-
position: relative;
10-
overflow: hidden;
7+
padding: 4rem 0;
8+
text-align: center;
9+
position: relative;
10+
overflow: hidden;
1111
}
1212

1313
@media screen and (max-width: 996px) {
14-
.heroBanner {
15-
padding: 2rem;
16-
}
14+
.heroBanner {
15+
padding: 2rem;
16+
}
1717
}
1818

1919
.buttons {
20-
display: flex;
21-
align-items: center;
22-
justify-content: center;
20+
display: flex;
21+
align-items: center;
22+
justify-content: center;
2323
}

src/pages/index.tsx

+3-55
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
1-
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
2-
import HomepageFeatures from "@site/src/components/HomepageFeatures";
3-
import Layout from "@theme/Layout";
4-
5-
// function HomepageHeader() {
6-
// const { siteConfig } = useDocusaurusContext();
7-
// return (
8-
// <header className={clsx("hero hero--primary", styles.heroBanner)}>
9-
// <div className="container">
10-
// <Heading as="h1" className="hero__title">
11-
// {siteConfig.title}
12-
// </Heading>
13-
// <p className="hero__subtitle">{siteConfig.tagline}</p>
14-
// </div>
15-
// </header>
16-
// );
17-
// }
18-
19-
import { useHistory } from "react-router-dom"; // Import useHistory hook
20-
21-
function HomepageHeader() {
22-
const history = useHistory(); // Initialize useHistory hook
23-
24-
// Function to navigate to the Blog section
25-
const goToBlog = () => {
26-
history.push("/blog"); // Redirect to the /blog route
27-
};
28-
29-
// Function to navigate to the Docs section
30-
const goToDocs = () => {
31-
history.push("/docs/introduction"); // Redirect to the /docs route
32-
};
33-
34-
return (
35-
<header>
36-
{/* Blog link */}
37-
<button onClick={goToBlog}>Go to Blog</button>
38-
39-
{/* Docs link */}
40-
<button onClick={goToDocs}>Go to Docs</button>
41-
</header>
42-
);
43-
}
1+
import { Redirect } from "@docusaurus/router";
442

453
export default function Home(): JSX.Element {
46-
const { siteConfig } = useDocusaurusContext();
47-
return (
48-
<Layout
49-
title={`Docs`}
50-
description="Description will go into a meta tag in <head />"
51-
>
52-
<HomepageHeader />
53-
<main>
54-
<HomepageFeatures />
55-
</main>
56-
</Layout>
57-
);
4+
// const { siteConfig } = useDocusaurusContext();
5+
return <Redirect to="/introduction" />;
586
}

0 commit comments

Comments
 (0)