Skip to Content
1robie

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:

SectionFolderServed at
Guidescontent/docs/docs//docs
Portfoliocontent/docs/portfolio//portfolio
Each plugincontent/docs/plugins/<id>//plugins/<id>
Each librarycontent/docs/libraries/<id>//libraries/<id>
Blogcontent/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.

Each folder's meta.json gives its sidebar title and the order of its pages:

content/docs/plugins/mekanized/installation/meta.json
{
  "title": "Installation",
  "defaultOpen": true,
  "pages": ["compatibility", "installing", "updating"]
}
  • A folder's index.mdx is the page you get when you click the folder. When a folder is only a group (Usage, Guides, Reference), its index.mdx is just front matter and <SectionCards />, which lists the folder's pages as cards.
  • A page appears in the sidebar under its title, or its sidebar_label when 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

CategoryRouteFolderListing
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:

kindPage set
pluginOverview → Installation → Configuration → Usage → Integrations → Help
plugin-apiThe above, plus Developer API (api/) last
plugin-frameworkplugin-api, plus Building with it (building/) before Integrations
libraryOverview → 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

  1. Add an entry to PROJECTS in src/data/projects.ts, with the right kind.
  2. Copy the folder of an existing project of the same kind, meta.json files included, to content/docs/<category>/<id>/, and rewrite the content.
  3. 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:

ComponentRenders
<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:admonitions catches 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.

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 #anchor in out/ 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 in scripts/urls.txt is 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

On this page