Skip to content

Commit 688b6fa

Browse files
authored
feat: Improve not found layout and add initial Readme (#15)
1 parent e05f61e commit 688b6fa

5 files changed

Lines changed: 132 additions & 117 deletions

File tree

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1-
# OrcaCD Documentation
1+
# <div align="center"><img src="https://raw.githubusercontent.com/OrcaCD/orca-cd/f6fb48965df90a57a2b181e9e2b359653ae5c6b9/frontend/public/assets/logo-dark-256.png" width="100"/> <br>OrcaCD Documentation</div>
22

3-
Work in progress...
3+
</div>
4+
5+
OrcaCD is a simple GitOps tool for Docker.
6+
7+
This website is built with [Fumadocs](https://www.fumadocs.dev/) and [Tanstack Start](https://tanstack.com/start/latest).
8+
9+
> [!WARNING]
10+
> OrcaCD is in early development and not yet production-ready. There are no stable releases. Expect breaking changes at any time.
11+
12+
## Contributing
13+
14+
### Setup
15+
16+
1. Install the dependencies:
17+
18+
```bash
19+
npm install
20+
```
21+
22+
2. Start the development server:
23+
24+
```bash
25+
npm run dev
26+
```
27+
28+
### Structure
29+
30+
The markdown files for the documentation are located in the `content/docs` folder.

src/components/github-release.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import useSWR from "swr";
2+
3+
export function GitHubRelease() {
4+
const { data, isLoading } = useSWR(
5+
"https://api.github.com/repos/OrcaCD/orca-cd/releases/latest",
6+
// oxlint-disable-next-line promise/prefer-await-to-then
7+
(...args) => fetch(...args).then((res) => res.json()),
8+
);
9+
10+
return (
11+
<a
12+
href="https://github.com/OrcaCD/orca-cd/releases"
13+
target="_blank"
14+
rel="noopener noreferrer"
15+
className="inline-flex items-center rounded-md border border-fd-border bg-fd-card px-1 py-0.5 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent"
16+
>
17+
{isLoading ? "..." : (data.tag_name ?? "No release yet")}
18+
</a>
19+
);
20+
}

src/components/not-found.tsx

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
import { Link } from "@tanstack/react-router";
1+
import { baseOptions, navbarLinks } from "@/lib/layout.shared";
2+
import { DefaultNotFound } from "fumadocs-ui/layouts/home/not-found";
23
import { HomeLayout } from "fumadocs-ui/layouts/home";
34

45
export function NotFound() {
56
return (
6-
<HomeLayout
7-
nav={{
8-
title: "Tanstack Start",
9-
}}
10-
className="text-center py-32 justify-center"
11-
>
12-
<div className="flex flex-col items-center gap-4">
13-
<h1 className="text-6xl font-bold text-fd-muted-foreground">404</h1>
14-
<h2 className="text-2xl font-semibold">Page Not Found</h2>
15-
<p className="text-fd-muted-foreground max-w-md">
16-
The page you are looking for might have been removed, had its name changed, or is
17-
temporarily unavailable.
18-
</p>
19-
<Link
20-
to="/"
21-
className="mt-4 px-4 py-2 rounded-lg bg-fd-primary text-fd-primary-foreground font-medium text-sm hover:opacity-90 transition-opacity"
22-
>
23-
Back to Home
24-
</Link>
25-
</div>
7+
<HomeLayout {...baseOptions()} links={navbarLinks}>
8+
<DefaultNotFound />
269
</HomeLayout>
2710
);
2811
}

src/lib/layout.shared.tsx

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
1+
import { Rocket, Book, Settings } from "lucide-react";
2+
import {
3+
NavbarMenu,
4+
NavbarMenuContent,
5+
NavbarMenuLink,
6+
NavbarMenuTrigger,
7+
} from "fumadocs-ui/layouts/home/navbar";
8+
import { GithubInfo } from "fumadocs-ui/components/github-info";
9+
10+
import type { BaseLayoutProps, LinkItemType } from "fumadocs-ui/layouts/shared";
11+
import { GitHubRelease } from "@/components/github-release";
212

313
export function baseOptions(): BaseLayoutProps {
414
return {
@@ -13,3 +23,69 @@ export function baseOptions(): BaseLayoutProps {
1323
},
1424
};
1525
}
26+
27+
export const navbarLinks: LinkItemType[] = [
28+
{
29+
type: "menu",
30+
on: "menu",
31+
text: "Documentation",
32+
items: [
33+
{
34+
text: "Introduction",
35+
url: "/docs",
36+
icon: <Book />,
37+
},
38+
{
39+
text: "Installation",
40+
url: "/docs/setup/installation",
41+
icon: <Rocket />,
42+
},
43+
{
44+
text: "Environment Variables",
45+
url: "/docs/configuration/env-variables",
46+
icon: <Settings />,
47+
},
48+
],
49+
},
50+
{
51+
type: "custom",
52+
on: "nav",
53+
children: (
54+
<NavbarMenu>
55+
<NavbarMenuTrigger>Docs</NavbarMenuTrigger>
56+
<NavbarMenuContent>
57+
<NavbarMenuLink href="/docs">
58+
<Book className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
59+
<p className="font-medium">Introduction</p>
60+
<p className="text-fd-muted-foreground text-sm">Welcome to OrcaCD</p>
61+
</NavbarMenuLink>
62+
<NavbarMenuLink href="/docs/setup/installation">
63+
<Rocket className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
64+
<p className="font-medium">Installation</p>
65+
<p className="text-fd-muted-foreground text-sm">
66+
Get OrcaCD running quickly with Docker installation.
67+
</p>
68+
</NavbarMenuLink>
69+
<NavbarMenuLink href="/docs/configuration/env-variables">
70+
<Settings className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
71+
<p className="font-medium">Environment Variables</p>
72+
<p className="text-fd-muted-foreground text-sm">
73+
Complete reference for all OrcaCD configuration options.
74+
</p>
75+
</NavbarMenuLink>
76+
</NavbarMenuContent>
77+
</NavbarMenu>
78+
),
79+
},
80+
{
81+
type: "custom",
82+
on: "nav",
83+
secondary: true,
84+
children: <GitHubRelease />,
85+
},
86+
{
87+
type: "custom",
88+
secondary: true,
89+
children: <GithubInfo owner="OrcaCD" repo="orca-cd" className="flex-row" />,
90+
},
91+
];

src/routes/index.tsx

Lines changed: 2 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createFileRoute, Link } from "@tanstack/react-router";
22
import { HomeLayout } from "fumadocs-ui/layouts/home";
3-
import { baseOptions } from "@/lib/layout.shared";
3+
import { baseOptions, navbarLinks } from "@/lib/layout.shared";
44
import {
55
GitBranch,
66
Container,
@@ -11,17 +11,7 @@ import {
1111
BookOpen,
1212
Users,
1313
Heart,
14-
Book,
15-
Settings,
1614
} from "lucide-react";
17-
import {
18-
NavbarMenu,
19-
NavbarMenuContent,
20-
NavbarMenuLink,
21-
NavbarMenuTrigger,
22-
} from "fumadocs-ui/layouts/home/navbar";
23-
import { GithubInfo } from "fumadocs-ui/components/github-info";
24-
import useSWR from "swr";
2515

2616
export const Route = createFileRoute("/")({
2717
component: Home,
@@ -70,89 +60,8 @@ function SmallFeature({
7060
}
7161

7262
function Home() {
73-
const { data, isLoading } = useSWR(
74-
"https://api.github.com/repos/OrcaCD/orca-cd/releases/latest",
75-
// oxlint-disable-next-line promise/prefer-await-to-then
76-
(...args) => fetch(...args).then((res) => res.json()),
77-
);
78-
7963
return (
80-
<HomeLayout
81-
{...baseOptions()}
82-
links={[
83-
{
84-
type: "menu",
85-
on: "menu",
86-
text: "Documentation",
87-
items: [
88-
{
89-
text: "Introduction",
90-
url: "/docs",
91-
icon: <Book />,
92-
},
93-
{
94-
text: "Installation",
95-
url: "/docs/setup/installation",
96-
icon: <Rocket />,
97-
},
98-
{
99-
text: "Environment Variables",
100-
url: "/docs/configuration/env-variables",
101-
icon: <Settings />,
102-
},
103-
],
104-
},
105-
{
106-
type: "custom",
107-
on: "nav",
108-
children: (
109-
<NavbarMenu>
110-
<NavbarMenuTrigger>Docs</NavbarMenuTrigger>
111-
<NavbarMenuContent>
112-
<NavbarMenuLink href="/docs">
113-
<Book className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
114-
<p className="font-medium">Introduction</p>
115-
<p className="text-fd-muted-foreground text-sm">Welcome to OrcaCD</p>
116-
</NavbarMenuLink>
117-
<NavbarMenuLink href="/docs/setup/installation">
118-
<Rocket className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
119-
<p className="font-medium">Installation</p>
120-
<p className="text-fd-muted-foreground text-sm">
121-
Get OrcaCD running quickly with Docker installation.
122-
</p>
123-
</NavbarMenuLink>
124-
<NavbarMenuLink href="/docs/configuration/env-variables">
125-
<Settings className="bg-fd-primary text-fd-primary-foreground p-1 mb-2 rounded-md" />
126-
<p className="font-medium">Environment Variables</p>
127-
<p className="text-fd-muted-foreground text-sm">
128-
Complete reference for all OrcaCD configuration options.
129-
</p>
130-
</NavbarMenuLink>
131-
</NavbarMenuContent>
132-
</NavbarMenu>
133-
),
134-
},
135-
{
136-
type: "custom",
137-
secondary: true,
138-
children: (
139-
<a
140-
href="https://github.com/OrcaCD/orca-cd/releases"
141-
target="_blank"
142-
rel="noopener noreferrer"
143-
className="inline-flex items-center rounded-md border border-fd-border bg-fd-card px-1 py-0.5 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent"
144-
>
145-
{isLoading ? "..." : (data.tag_name ?? "No release yet")}
146-
</a>
147-
),
148-
},
149-
{
150-
type: "custom",
151-
secondary: true,
152-
children: <GithubInfo owner="OrcaCD" repo="orca-cd" className="flex-row" />,
153-
},
154-
]}
155-
>
64+
<HomeLayout {...baseOptions()} links={navbarLinks}>
15665
<section className="relative overflow-hidden border-b border-fd-border">
15766
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top,var(--color-fd-primary)/0.08,transparent_60%)]" />
15867
<div className="relative mx-auto max-w-5xl px-6 py-24 text-center md:py-36">

0 commit comments

Comments
 (0)