Part 2: Install Docusaurus - Laying the Foundation
· One min read
In software, installation is like laying the foundation of a building. If you get it wrong, everything built on top of it will eventually crack.
The Core Packages
npm install @docusaurus/core@latest \
@docusaurus/preset-classic@latest \
@docusaurus/module-type-aliases@latest \
@docusaurus/tsconfig@latest \
@docusaurus/types@latest
The Configuration
Create docusaurus.config.ts with:
- Site metadata (title, tagline, URL)
- Preset configuration (docs, blog, theme)
- Theme config (navbar, footer, prism)
The Sidebar
Create sidebars.ts for documentation navigation structure.
Updating Scripts
{
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build",
"clear": "docusaurus clear",
"serve": "docusaurus serve"
}
}
The Moment of Truth
Run npm start. You'll likely see errors—that's expected. The foundation is laid.
Next: Part 3 - Restructure Project: The Great Reorganization
