Site architecture
How the Next.js + Fumadocs site is put together: sections, the project registry, page sets, theming, search, checks and deploys.
This site is a Next.js app using Fumadocs, exported as static HTML and served by GitHub Pages. It hosts a portfolio, cross-project guides, one documentation set per plugin and library, and a blog. This page explains how that is wired, so future-you can change it safely.
One source, many sections
Every docs page lives under content/docs/ and is compiled by fumadocs-mdx
(configured in source.config.ts). A single Fumadocs loader
(src/lib/source.ts) serves them all from the site root, so the folder is the
URL:
| Section | Folder | Served at |
|---|---|---|
| Guides | content/docs/docs/ | /docs |
| Portfolio | content/docs/portfolio/ | /portfolio |
| Each plugin | content/docs/plugins/<id>/ | /plugins/<id> |
| Each library | content/docs/libraries/<id>/ | /libraries/<id> |
| Blog | content/blog/ (its own collection) | /blog |
Each section folder is a root folder: its meta.json has "root": true.
The sidebar then shows only the section you are reading, and the switcher at the
top of the sidebar moves between sections. One route renders every docs page:
src/app/(docs)/[...slug]/page.tsx, inside the docs layout.
The home page, /plugins, /libraries, the blog and the 404 page are ordinary
Next.js pages under src/app/(home)/, with the home layout and the footer.
Static routes win over the docs catch-all, so /plugins (the listing) and
/plugins/mekanized (a docs page) do not collide.
There is no site-wide API section
A Java API belongs to a specific project, so each project's API docs are a
folder inside that project (api/), not a section of their own.
Sidebars come from meta.json
Each folder's meta.json gives its sidebar title and the order of its pages:
{
"title": "Installation",
"defaultOpen": true,
"pages": ["compatibility", "installing", "updating"]
}- A folder's
index.mdxis the page you get when you click the folder. When a folder is only a group (Usage, Guides, Reference), itsindex.mdxis just front matter and<SectionCards />, which lists the folder's pages as cards. - A page appears in the sidebar under its
title, or itssidebar_labelwhen set. Landing pages use that: titled "Mekanized", listed as "Overview".
The project registry
src/data/projects.ts is the single source of truth for every plugin and
library. From the PROJECTS array come the Minecraft navbar menu, the
footer columns, the /plugins and /libraries listings, the sidebar section
icons, llms.txt, and every value the MDX components print (versions,
coordinates, download links). Adding a project never means editing a layout.
Two categories, one menu
| Category | Route | Folder | Listing |
|---|---|---|---|
| Plugins | /plugins/<id> | content/docs/plugins/<id>/ | /plugins |
| Libraries | /libraries/<id> | content/docs/libraries/<id>/ | /libraries |
The category is derived from kind by projectCategory(): plugin,
plugin-api and plugin-framework are plugins. A server owner looking for a
jar and a developer looking for a dependency are not the same visitor, so the
two are separate sections, grouped under one Minecraft menu with a heading
per group.
The page set follows the project kind
Server owners and plugin developers want nothing in common, so kind fixes
which pages a project has:
kind | Page set |
|---|---|
plugin | Overview → Installation → Configuration → Usage → Integrations → Help |
plugin-api | The above, plus Developer API (api/) last |
plugin-framework | plugin-api, plus Building with it (building/) before Integrations |
library | Overview → Getting started → Guides → Reference → Help → Migrating → Changelog |
Server-owner sections come first and the developer section last: most visitors to a plugin page are server owners, and a developer will scroll past install instructions while the reverse is not true.
Fumadocs builds the sidebar from the folders, so a missing page would simply be
missing. scripts/check-project-shape.ts (npm run check:shape) puts the
guarantee back: it fails if a project lacks a page of its kind's set, or its
root meta.json. Every plugin then documents the same things in the same
places.
Adding a project
- Add an entry to
PROJECTSinsrc/data/projects.ts, with the rightkind. - Copy the folder of an existing project of the same kind,
meta.jsonfiles included, tocontent/docs/<category>/<id>/, and rewrite the content. npm run check. The project is live at/<category>/<id>.
Values that must not go stale
Never type a version, a Maven coordinate or a store URL into Markdown. These components read the registry and are available in every page without an import:
| Component | Renders |
|---|---|
<DependencySnippet project="…" /> | Gradle Kotlin / Gradle Groovy / Maven snippets, highlighted |
<CompatibilityTable project="…" /> | Supported server software and Minecraft versions |
<JavadocLink project="…" /> | Link to the project's Javadoc |
<DownloadLinks project="…" /> | Download buttons, latest release, dev builds |
Bumping latestVersion updates every snippet on the site at once. An unknown
project id fails the build.
Versions
The docs describe the current release of each project; there is no version
dropdown. When a project needs frozen docs for an older release, copy its folder
to a version subfolder (for example content/docs/plugins/<id>/v1/, with its
own meta.json), link it from the overview, and add its URLs to
scripts/urls.txt.
Writing content
All pages are .mdx. Besides Markdown:
- Admonitions keep the Docusaurus syntax:
:::note,:::tip,:::info,:::warning,:::danger,:::success, with an optional title in brackets (:::warning[Title]). They render as Fumadocs callouts. The title must stay on the opening line;npm run lint:admonitionscatches what does not render. - Fumadocs components are available without imports:
<Callout>,<Cards>/<Card>,<Tabs>/<Tab>,<Steps>/<Step>,<Files>/<Folder>/<File>,<Accordions>/<Accordion>,<TypeTable>. Use<Tabs groupId="build-tool" persist items={[…]}>for build-tool tabs so the reader's choice follows them across pages. - Code blocks take a title (
```yaml title="config.yml") and are highlighted at build time by Shiki. - Links: relative file links (
./updating.mdx) work inside a section and are turned into URLs; between sections use site paths (/plugins/mekanized). - Images go in
public/img/and open full size on click.
Each page also gets, for free: a table of contents, "Copy Markdown" and "Open in…" (ChatGPT, Claude) buttons, an "Edit on GitHub" link, and its last-updated date from git.
Theming
Fumadocs styles everything with Tailwind CSS 4 and its own --color-fd-*
tokens. src/app/global.css sets the brand blue (#185adb, and a lighter tint
in dark mode, where the base blue fails contrast) and the site tokens
(--site-hero-gradient, --site-accent). Components use Tailwind classes and
fd- colours (text-fd-muted-foreground, bg-fd-card), never hardcoded
colours, so light and dark mode both work.
Search
The search dialog (Ctrl K) searches every docs section.
The index is a static JSON file (/api/search) written at build time from the
same source as the pages, and searched in the browser with Orama. No search
service, no network call besides that file.
For machines
/llms.txt: an index of every page, llmstxt.org style./llms-full.txt: every page as Markdown, in one file./llms.mdx/<page path>/content.md: one page as Markdown (what "Copy Markdown" fetches)./sitemap.xml,/robots.txt, and an RSS and Atom feed of the blog (/blog/rss.xml,/blog/atom.xml).
Checks
npm run check runs everything, in this order: types, ESLint, Prettier,
admonitions, project shapes, the build, then two checks on the exported site:
check:links: every internal link and#anchorinout/points to a page and a heading that exist. Links written by components and layouts are covered too, because it reads the rendered HTML.check:urls: every URL inscripts/urls.txtis still exported. The list was seeded from the last Docusaurus build, so links from READMEs, store pages and search engines keep working. Retiring a URL means deleting its line in the same commit.
Deployment
.github/workflows/deploy.yml runs npm run check on every push to main,
then uploads out/ to GitHub Pages. ci.yml runs the same check on pull
requests and other branches. Nothing is ever pushed to a branch: main holds
this source.
The export is static (output: 'export' in next.config.mjs): every route is
generated at build time, and there is no middleware, server redirect or runtime
API. With trailingSlash: false, /plugins/mekanized is served from
plugins/mekanized.html. The repository is a GitHub user site, served from
the domain root; https://1robie.github.io/maven/ is a different repository
(1robie/maven) served under the same domain, so this site must never create a
/maven route.
Last updated on