Quick Start
Getting Started with Adalt.
Introduction
Adalt is a documentation framework based on Next.js, designed to be fast and flexible. It composes seamlessly into Next.js App Router, and benefits from the React Server Component model.
Adalt docs has different parts:
Adalt Core
The core of Adalt. Just like the CPU, it handles most of the logic, including document search, content source adapters, and Markdown/MDX plugins.
Adalt UI
The default theme of Adalt, it offers a beautiful look for documentation sites and many interactive components.
Content Source
The input/source of your content, it can be a CMS, or local data layers like Content Collections and Adalt MDX.
Adalt CLI
A command line tool to configure features automatically, and copy components from Adalt UI (similar to Shadcn UI).
Adalt Core will process your content source, hence theoretically any kind of format and source can be supported by Adalt docs.
Adalt MDX is the official content source of Adalt.
Use Cases
Documentation
Adalt docs focuses on authoring experience, it provides a beautiful theme and many docs automation tools.
It helps you to iterate your codebase faster while never leaving your docs behind. You can take this site as an example of docs site built with Adalt.
Blog sites
Since Next.js is already a powerful framework, most features can be implemented with only Next.js.
Adalt Core can process the content (e.g. syntax highlighting), and you can render it with the default theme (Adalt UI) or your custom theme. It is particularly helpful if you want to build complicated things like search.
Terminology
For a better understanding of the docs, there are some common terminologies you should know:
Page Tree: A tree of all the pages, separators and folders. It is essential for navigation elements. It should be generated by the content source, you may also hardcode it. Types definitions can be found at Page Tree.
MDX File & Page: A MDX file could be located in a folder, or available remotely. Instead, MDX Page is only referring to page.mdx
, which is already a page on its own.
You might need to be familiar with Next.js App Router to continue.
Automatic Installation
Create a new app with create-styledsea-docs-app
, it requires Node.js 18+.
It will ask you the following questions:
- Which content source to use? (Recommended: Adalt MDX)
- Configure Tailwind CSS?
- Install dependencies?
After that, it will initialize a new Adalt app. Now you can start hacking!
Enjoy!
Create your first mdx file in the docs folder.
Run the app in development mode and see http://localhost:3000/docs.
Explore
In the project, you can see:
lib/source.ts
: Where you organize code for the source adapter, it is used here to read from your content source.app/layout.config.tsx
: Shared options for layouts, this is optional but preferred to keep.app/(home)
: The route group for your landing page and other pages.app/docs
: The entire docs.app/api/search/route.ts
: The Route Handler for Search.
FAQ
Some common questions you may encounter.
Learn More
New to here? Don't worry, we are welcome for your questions.
If you find anything confusing, please give your feedback on Github Discussion!
Organizing Pages
Learn how to organize your pages
Learn i18n
Learn how to implement i18n
Theming
Add themes to Adalt UI
Markdown
Learn how to write documents in Adalt
From Existing Codebase?
You can follow the Manual Installation guide to get started.
Last updated on