Skip to content

Commit c6ac246

Browse files
luandroclaude
andauthored
Remove landing page, open documentation directly (#100)
* feat: redirect root to first docs page, removing landing page Add redirect from root path (/) to the default documentation page, effectively skipping the landing page and opening directly to the first documentation page. Resolves #92 * fix: use Redirect component to skip landing page Replace landing page content with Redirect component from @docusaurus/router to properly redirect users to the first documentation page. The previous approach using plugin-client-redirects doesn't work for existing pages. This solution: - Replaces the landing page component with a simple redirect - Uses the same defaultDocsPage logic from customFields - Works immediately on page load without requiring build-time redirects Resolves #92 --------- Co-authored-by: Claude <[email protected]>
1 parent 2f2a47a commit c6ac246

File tree

1 file changed

+3
-76
lines changed

1 file changed

+3
-76
lines changed

src/pages/index.tsx

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,11 @@
11
import type { ReactNode } from "react";
2-
import clsx from "clsx";
3-
import Link from "@docusaurus/Link";
2+
import { Redirect } from "@docusaurus/router";
43
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
5-
import Layout from "@theme/Layout";
6-
import HomepageFeatures from "../components/HomepageFeatures";
7-
import Heading from "@theme/Heading";
8-
import { translate } from "@docusaurus/Translate";
9-
import styles from "./index.module.css";
104

11-
function HomepageHeader() {
5+
export default function Home(): ReactNode {
126
const { siteConfig } = useDocusaurusContext();
137
const defaultDocsPage =
148
(siteConfig.customFields?.defaultDocsPage as string) || "introduction";
159

16-
return (
17-
<header className={clsx("hero hero--primary", styles.heroBanner)}>
18-
<div className="container">
19-
<img src="img/comapeo_logo.png" alt="CoMapeo Logo" />
20-
<Heading as="h1" className="hero__title">
21-
{translate({
22-
message: "Documentation",
23-
description: "Site title",
24-
})}
25-
</Heading>
26-
<p className="hero__subtitle">
27-
{translate({
28-
message: "Learn how to use the CoMapeo platform",
29-
description: "Text for the tagline of the webpage",
30-
})}
31-
</p>
32-
<div className={styles.buttons}>
33-
<Link
34-
className="button button--secondary button--lg"
35-
to={`/docs/${defaultDocsPage}`}
36-
>
37-
{translate({
38-
message: "Explore Documentation",
39-
description: "Button text for documentation link",
40-
})}
41-
</Link>
42-
<Link
43-
className="button button--success button--lg"
44-
href="https://wa.me/yourphonenumber"
45-
target="_blank"
46-
rel="noopener noreferrer"
47-
>
48-
{/* <i className="fa fa-whatsapp" style={{marginRight: '8px'}}></i> */}
49-
{translate({
50-
message: "WhatsApp Assistant",
51-
description: "Button text for WhatsApp support link",
52-
})}
53-
</Link>
54-
<Link
55-
className="button button--info button--lg"
56-
href="https://t.me/yourusername"
57-
target="_blank"
58-
rel="noopener noreferrer"
59-
>
60-
{/* <i className="fa fa-telegram" style={{marginRight: '8px'}}></i> */}
61-
{translate({
62-
message: "Telegram Assistant",
63-
description: "Button text for Telegram support link",
64-
})}
65-
</Link>
66-
</div>
67-
</div>
68-
</header>
69-
);
70-
}
71-
export default function Home(): ReactNode {
72-
const { siteConfig } = useDocusaurusContext();
73-
return (
74-
<Layout
75-
title={`${siteConfig.title}`}
76-
description="Description will go into a meta tag in <head />"
77-
>
78-
<HomepageHeader />
79-
<main>
80-
<HomepageFeatures />
81-
</main>
82-
</Layout>
83-
);
10+
return <Redirect to={`/docs/${defaultDocsPage}`} />;
8411
}

0 commit comments

Comments
 (0)