diff --git a/README.md b/README.md index a262573..3c998b5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,30 @@ -# OrcaCD Documentation +#

OrcaCD Documentation
-Work in progress... + + +OrcaCD is a simple GitOps tool for Docker. + +This website is built with [Fumadocs](https://www.fumadocs.dev/) and [Tanstack Start](https://tanstack.com/start/latest). + +> [!WARNING] +> OrcaCD is in early development and not yet production-ready. There are no stable releases. Expect breaking changes at any time. + +## Contributing + +### Setup + +1. Install the dependencies: + +```bash +npm install +``` + +2. Start the development server: + +```bash +npm run dev +``` + +### Structure + +The markdown files for the documentation are located in the `content/docs` folder. diff --git a/src/components/github-release.tsx b/src/components/github-release.tsx new file mode 100644 index 0000000..04c6eeb --- /dev/null +++ b/src/components/github-release.tsx @@ -0,0 +1,20 @@ +import useSWR from "swr"; + +export function GitHubRelease() { + const { data, isLoading } = useSWR( + "https://api.github.com/repos/OrcaCD/orca-cd/releases/latest", + // oxlint-disable-next-line promise/prefer-await-to-then + (...args) => fetch(...args).then((res) => res.json()), + ); + + return ( + + {isLoading ? "..." : (data.tag_name ?? "No release yet")} + + ); +} diff --git a/src/components/not-found.tsx b/src/components/not-found.tsx index b2ef24d..9b6225d 100644 --- a/src/components/not-found.tsx +++ b/src/components/not-found.tsx @@ -1,28 +1,11 @@ -import { Link } from "@tanstack/react-router"; +import { baseOptions, navbarLinks } from "@/lib/layout.shared"; +import { DefaultNotFound } from "fumadocs-ui/layouts/home/not-found"; import { HomeLayout } from "fumadocs-ui/layouts/home"; export function NotFound() { return ( - -
-

404

-

Page Not Found

-

- The page you are looking for might have been removed, had its name changed, or is - temporarily unavailable. -

- - Back to Home - -
+ + ); } diff --git a/src/lib/layout.shared.tsx b/src/lib/layout.shared.tsx index 214b7ba..b8edb24 100644 --- a/src/lib/layout.shared.tsx +++ b/src/lib/layout.shared.tsx @@ -1,4 +1,14 @@ -import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared"; +import { Rocket, Book, Settings } from "lucide-react"; +import { + NavbarMenu, + NavbarMenuContent, + NavbarMenuLink, + NavbarMenuTrigger, +} from "fumadocs-ui/layouts/home/navbar"; +import { GithubInfo } from "fumadocs-ui/components/github-info"; + +import type { BaseLayoutProps, LinkItemType } from "fumadocs-ui/layouts/shared"; +import { GitHubRelease } from "@/components/github-release"; export function baseOptions(): BaseLayoutProps { return { @@ -13,3 +23,69 @@ export function baseOptions(): BaseLayoutProps { }, }; } + +export const navbarLinks: LinkItemType[] = [ + { + type: "menu", + on: "menu", + text: "Documentation", + items: [ + { + text: "Introduction", + url: "/docs", + icon: , + }, + { + text: "Installation", + url: "/docs/setup/installation", + icon: , + }, + { + text: "Environment Variables", + url: "/docs/configuration/env-variables", + icon: , + }, + ], + }, + { + type: "custom", + on: "nav", + children: ( + + Docs + + + +

Introduction

+

Welcome to OrcaCD

+
+ + +

Installation

+

+ Get OrcaCD running quickly with Docker installation. +

+
+ + +

Environment Variables

+

+ Complete reference for all OrcaCD configuration options. +

+
+
+
+ ), + }, + { + type: "custom", + on: "nav", + secondary: true, + children: , + }, + { + type: "custom", + secondary: true, + children: , + }, +]; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index a7f7cd4..2bf0fad 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,6 +1,6 @@ import { createFileRoute, Link } from "@tanstack/react-router"; import { HomeLayout } from "fumadocs-ui/layouts/home"; -import { baseOptions } from "@/lib/layout.shared"; +import { baseOptions, navbarLinks } from "@/lib/layout.shared"; import { GitBranch, Container, @@ -11,17 +11,7 @@ import { BookOpen, Users, Heart, - Book, - Settings, } from "lucide-react"; -import { - NavbarMenu, - NavbarMenuContent, - NavbarMenuLink, - NavbarMenuTrigger, -} from "fumadocs-ui/layouts/home/navbar"; -import { GithubInfo } from "fumadocs-ui/components/github-info"; -import useSWR from "swr"; export const Route = createFileRoute("/")({ component: Home, @@ -70,89 +60,8 @@ function SmallFeature({ } function Home() { - const { data, isLoading } = useSWR( - "https://api.github.com/repos/OrcaCD/orca-cd/releases/latest", - // oxlint-disable-next-line promise/prefer-await-to-then - (...args) => fetch(...args).then((res) => res.json()), - ); - return ( - , - }, - { - text: "Installation", - url: "/docs/setup/installation", - icon: , - }, - { - text: "Environment Variables", - url: "/docs/configuration/env-variables", - icon: , - }, - ], - }, - { - type: "custom", - on: "nav", - children: ( - - Docs - - - -

Introduction

-

Welcome to OrcaCD

-
- - -

Installation

-

- Get OrcaCD running quickly with Docker installation. -

-
- - -

Environment Variables

-

- Complete reference for all OrcaCD configuration options. -

-
-
-
- ), - }, - { - type: "custom", - secondary: true, - children: ( - - {isLoading ? "..." : (data.tag_name ?? "No release yet")} - - ), - }, - { - type: "custom", - secondary: true, - children: , - }, - ]} - > +