Introduction
minidocs helps you build a documentation site with Astro. It does not ship a finished site or a theme: your content lives in Astro content collections, you write the pages yourself, and minidocs provides the data, components and styles those pages need.
How it differs from a theme
A themed documentation framework ships a complete site, and you customize it through options. When a need falls outside the options, you replace components inside the theme.
With minidocs, the page layout is your code from the start. Where the sidebar goes, what it shows, whether an item gets a badge: all of it is written in your layout file, with no need for the framework to have left a slot for it.
What minidocs provides
- Data: the document tree, where the current page sits in it, and the previous and next pages, all computed from your content collection
- Components: Astro components for the sidebar, table of contents, previous and next links, callouts and a search dialog. Interactions such as collapsing groups, the drawer on narrow screens and highlighting the table of contents come with them
- Styles: optional default styles, which your own styles always override
- Content: links to
.mdand.mdxfiles in your writing,:::tipcallouts, and a Markdown version and llms.txt for every page
Each part works on its own. If a component does not fit, write your own HTML instead; if you do not want the default styles, do not import them.
Data goes through your code
Components never read the document tree themselves. You take the data out of the tree and pass it to them as props. So any frontmatter field can show up in your sidebar, such as a badge on a page:
<Sidebar.Link {...nav.of(node)}>
{node.label}
{node.page?.entry.data.badge && <span class="badge">{node.page.entry.data.badge}</span>}
</Sidebar.Link>
This is one item of a sidebar: node is a page in the document tree, and nav.of(node) gives its link and whether it is the current page. As long as badge is declared in the collection’s schema, it is fully typed.
Next, Getting Started builds a docs site from scratch.