Shared components, layouts, shortcodes, theme, and build tooling for NukeHub documentation sites.
- Astro layouts:
BaseLayout,DocLayout - Docs components:
TableOfContents,Pagination,EditLink,NotFound - React components: header, footer, sidebar, command palette, theme toggle, search, scroll progress, context menu, lightbox
- MDX shortcodes:
Callout,Tabs,TabItem,FileTree,Mermaid,Steps,Step,YouTube,Odysee,ImageFigure,DataTable - Theme: Tailwind CSS v4 tokens, dark/light/system mode, accent-color picker, and global styles. The favicon and theme-color meta tag follow the selected accent.
- Utilities:
cn, sidebar/pagination helpers, theme helpers - Build integration:
markdownNegotiationemits a Markdown sibling for every HTML page - Sync CLI:
nukehub-sync-docscopies and cleans docs from../docs/intosrc/content/docs/
npm install @nukehub/docs-kit-
Create a fresh Astro project or use the
docs-templaterepo as a starting point. -
Add project-specific files:
src/ ├── content.config.ts ├── data/ │ ├── site.ts │ ├── nav.ts │ └── footer.ts ├── env.d.ts └── pages/ ├── [...slug].astro └── 404.astro -
Import layouts from the kit:
--- import DocLayout from "@nukehub/docs-kit/components/layout/DocLayout.astro"; import BaseLayout from "@nukehub/docs-kit/components/layout/BaseLayout.astro"; ---
Pass your
site,navItems,footerColumns, andfooterLegalas props toDocLayoutandBaseLayout. -
Add
astro.config.mjsusing the kit'smarkdownNegotiationintegration and@tailwindcss/vite. -
Add docs under
docs/and runnpx nukehub-sync-docs.
The kit generates a dynamic, theme-aware favicon so the tab icon matches the user's selected accent and resolved light/dark mode.
- Place a
favicon.svgin your project'spublic/directory. It is used as the no-JS fallback. - When JavaScript runs, the kit replaces it with a data-URI SVG colored from the current
--primaryCSS variable. - The dynamic favicon uses the built-in NukeHub logo paths. To use a custom logo dynamically, override
BaseLayout.astroor provide your own favicon generation script.
Use the NotFound component for a themed 404 page:
---
import BaseLayout from "@nukehub/docs-kit/components/layout/BaseLayout.astro";
import NotFound from "@nukehub/docs-kit/components/docs/NotFound.astro";
---
<BaseLayout site={SITE} navItems={navItems} title={`404 — Page not found | ${SITE.name}`}>
<NotFound base={SITE.base} />
</BaseLayout>When the kit improves, pull the latest version in any consuming project:
npm update @nukehub/docs-kitNo need to copy files or cherry-pick template changes.
docs-template— reference consumer of this kit.