Codebase Architecture #
This guide explains the full MiniWiki codebase and how content becomes rendered pages.
Top-level folders #
content/: MDX pages and JSON configcomponents/: reusable UI + MDX componentslayouts/: wiki shell and site presetstemplates/: optional page-level wrapperslib/: content + navigation loaderspages/: Next.js runtime entry pointsstyles/: global Tailwind/CSS overridespublic/: static assets
Request/render flow #
- Route comes into
pages/[[...slug]].js - Slug maps to an
.mdxfile incontent/ - Frontmatter is parsed (
gray-matter) - MDX is serialized (
next-mdx-remote) with markdown plugins - Site config + nav JSON are loaded
- Layout preset wraps page content
- MDX renders with registered components from
components/mdx-components.js
Content system #
- Every
.mdxfile undercontent/becomes a route content/home.mdxmaps to/- Nested files map to nested routes
Configuration system #
content/site.json: behavior and brandingcontent/header.json: top linkscontent/sidebar.json: left navigationcontent/templates.json: template registry/defaults
Styling system #
- Tailwind utilities for component styling
- Global rules in
styles/globals.css wikiPresetcontrols site-wide shell styling
Treat content/ as the source of truth for docs and components/ as the design system.