A NukeHub-first documentation template built with plain Astro + React + Tailwind CSS v4. No Starlight, no chrome clashes — every pixel of the header, footer, sidebar, search, and theme is custom and reusable.
This repository is a reusable template for documentation sites in the NukeHub ecosystem. It replaces Starlight with a small set of custom components while keeping the content workflow the same:
- Write docs in Markdown/MDX under
docs/in the repo root. - Run
npm run sync-docsto copy and clean them intosrc/content/docs/. - Build a static site ready for GitHub Pages.
-
Click Use this template on GitHub and create a new repository.
-
Clone the new repository.
-
Install dependencies:
npm install
-
Update project identity in
src/data/site.ts:export const SITE = { name: "Your Project", logoText: "Your Project", description: "A short description.", site: "https://your-org.github.io", base: "/your-repo", github: "https://github.com/your-org/your-repo", editBranch: "main", editPath: "docs/", };
The
basevalue must match your GitHub repository name. -
Add your own documentation under
docs/in the repo root. -
Run
npm run devto preview locally. -
Push to
main; the GitHub Actions workflow in.github/workflows/deploy.ymlpublishes to Pages.
| File | Purpose |
|---|---|
src/data/site.ts |
Site name, description, base path, GitHub URLs. |
src/data/nav.ts |
Header navigation items. |
src/data/footer.ts |
Footer link columns. |
Update these three files to rebrand the site for any project.
Create files under docs/:
docs/
├── README.md # Becomes the home page
├── tutorials/
│ └── getting-started.md
├── reference/
│ └── index.md
├── development/
│ └── local-dev.md
└── architecture/
└── overview.md
Each page supports this frontmatter:
---
title: Page Title
description: A short description.
sidebar:
label: Short label
order: 1
draft: false
---The root README.md is renamed to index.md automatically, and internal .md links are rewritten to clean trailing-slash routes.
| Script | Purpose |
|---|---|
npm run dev |
Sync docs and start the dev server. |
npm run build |
Sync docs and build the static site. |
npm run preview |
Preview the built site. |
npm run check |
Run Astro type checks. |
npm run lint |
Run ESLint. |
npm run format |
Format files with Prettier. |
npm run format:check |
Check formatting without writing. |
Pages written as .mdx can use these components without importing them:
<Callout type="tip" title="Tip">
Use `npm run sync-docs` before building to refresh content.
</Callout>
<Tabs defaultValue="npm">
<TabItem value="npm" label="npm">
npm install
</TabItem>
<TabItem value="pnpm" label="pnpm">
pnpm install
</TabItem>
</Tabs>
<FileTree items={[{ name: "docs", children: [{ name: "README.md" }] }]} />
<Mermaid chart={`flowchart LR; A --> B`} />
<Steps>
<Step>Do this first.</Step>
<Step>Then do this.</Step>
</Steps>
<YouTube id="dQw4w9WgXcQ" title="Getting started" />
<ImageFigure src="/docs-template/screenshot.png" alt="Screenshot" caption="Docs template" />
<DataTable
columns={[{ key: "name", header: "Name" }]}
data={[{ name: "U-235" }]}
sortable
searchable
/>Supported types for <Callout>: info, note, warning, tip, success, danger.
Code blocks in Markdown and MDX automatically get a copy button.
src/
├── components/
│ ├── layout/ # Header, Footer, Sidebar, BaseLayout, DocLayout
│ ├── shared/ # Command palette, theme toggle, search, scroll progress, context menu, lightbox
│ ├── ui/ # Button, Card, Tooltip, Logo, Input, Image
│ ├── docs/ # TOC, Pagination, EditLink
│ └── mdx/ # Callout, Tabs, TabItem, FileTree, Mermaid, Steps, YouTube, Odysee, ImageFigure, DataTable shortcodes
├── content/ # Synced docs content
├── data/ # site.ts, nav.ts, footer.ts
├── lib/ # utils.ts, theme.ts, docs.ts
├── pages/
│ └── [...slug].astro
└── styles/
└── global.css
The included .github/workflows/deploy.yml builds and deploys to GitHub Pages on every push to main. Make sure the repository Pages source is set to GitHub Actions.
Every built HTML page also gets a Markdown sibling. For example, /tutorials/getting-started/ has a matching /tutorials/getting-started/index.md.
- Direct
.mdURLs serve the Markdown file. public/_worker.jsenablesAccept: text/markdowncontent negotiation on hosts that support Cloudflare Pages advanced-mode Workers.- GitHub Pages serves the generated
.mdfiles statically, but cannot negotiate byAcceptheader.
- The theme engine stores the preference in
localStorageunderdocs-themeand applies it viadata-themeon<html>. - The command palette indexes doc titles, descriptions, and categories; open it with Cmd/Ctrl+K.
- Right-click anywhere to open a custom context menu with search, copy, and navigation.
- The sidebar is generated from the synced docs file tree.
- A scroll-progress bar appears at the top of doc pages.
- Code blocks get an automatic copy button.
- No
@astrojs/starlightdependency is included.
BSD-2-Clause — see the LICENSE file.