Skip to content

Commit a828049

Browse files
authored
Create documentation page for navigation (#26)
* Move docs pages into their own folder * Create placeholder docs page * Create route for docs page * Create nav entry for docs page * Create content for docs card grid * Implement card grid
1 parent 1bdeb71 commit a828049

File tree

8 files changed

+70
-5
lines changed

8 files changed

+70
-5
lines changed

src/app/docs.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import {
2+
Card,
3+
CardDescription,
4+
CardHeader,
5+
CardTitle,
6+
} from "@/components/ui/card";
7+
import { Link } from "react-router";
8+
9+
const docs = [
10+
{
11+
title: "Auto Splitters",
12+
description:
13+
"Documentation and tips for creating auto splitters for LibreSplit.",
14+
to: "/docs/auto-splitters.md",
15+
},
16+
{
17+
title: "Settings and Keybinds",
18+
description: "Customize controls and behavior.",
19+
to: "/docs/settings-keybinds.md",
20+
},
21+
{
22+
title: "Split Files",
23+
description: "JSON split file documentation.",
24+
to: "/docs/split-files.md",
25+
},
26+
{
27+
title: "Themes",
28+
description: "Style the app to your liking.",
29+
to: "/docs/themes.md",
30+
},
31+
{
32+
title: "Troubleshooting",
33+
description: "Fix common issues and edge cases.",
34+
to: "/docs/troubleshooting.md",
35+
},
36+
];
37+
38+
export function Docs() {
39+
return (
40+
<div className="mx-auto max-w-5xl px-6 py-12">
41+
<h1 className="mb-8 text-3xl font-bold">Documentation</h1>
42+
43+
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
44+
{docs.map((doc) => (
45+
<Link key={doc.to} to={doc.to}>
46+
<Card className="h-full transition hover:border-primary hover:shadow-lg">
47+
<CardHeader>
48+
<CardTitle>{doc.title}</CardTitle>
49+
<CardDescription>{doc.description}</CardDescription>
50+
</CardHeader>
51+
</Card>
52+
</Link>
53+
))}
54+
</div>
55+
</div>
56+
);
57+
}

src/components/libresplit/AppNav.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ export function AppNav() {
2424
</NavigationMenuLink>
2525
</NavigationMenuItem>
2626

27+
<NavigationMenuItem>
28+
<NavigationMenuLink asChild>
29+
<Link to="/docs">Docs</Link>
30+
</NavigationMenuLink>
31+
</NavigationMenuItem>
32+
2733
<NavigationMenuItem>
2834
<NavigationMenuLink asChild>
2935
<Link to="/converter">Converter</Link>

src/router.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
import { AutoSplitters } from "./app/auto-splitters";
21
import { Converter } from "./app/converter";
2+
import { Docs } from "./app/docs";
3+
import { AutoSplitters } from "./app/docs/auto-splitters";
4+
import { SettingsKeybinds } from "./app/docs/settings-keybinds";
5+
import { SplitFiles } from "./app/docs/split-files";
6+
import { Themes } from "./app/docs/themes";
7+
import { Troubleshooting } from "./app/docs/troubleshooting";
38
import { Home } from "./app/home";
49
import { NotFound } from "./app/not-found";
5-
import { SettingsKeybinds } from "./app/settings-keybinds";
6-
import { SplitFiles } from "./app/split-files";
7-
import { Themes } from "./app/themes";
8-
import { Troubleshooting } from "./app/troubleshooting";
910
import { Route, Routes } from "react-router";
1011

1112
export default function AppRouter() {
1213
return (
1314
<Routes>
1415
<Route path="/" element={<Home />} />
16+
<Route path="/docs" element={<Docs />} />
1517
<Route path="/converter" element={<Converter />} />
1618

1719
{/* Documentation pages pulled from GitHub. */}

0 commit comments

Comments
 (0)