Docusaurus Quick Start Guide
๐ Quick Setup (5 minutes)โ
Option 1: Automated Setup (Recommended)โ
cd docs
./setup-docusaurus.sh
This script will:
- Clean old VitePress artifacts
- Install Docusaurus dependencies
- Create favicon from logo
- Test the build
- Show next steps
Option 2: Manual Setupโ
cd docs
# Install dependencies
npm install
# Start development server
npm run start
# Build for production
npm run build
๐ Quick Commandsโ
Command | Description |
---|---|
npm run start | Start dev server at http://localhost:3000 |
npm run build | Build production site |
npm run serve | Preview production build |
npm run clear | Clear cache |
npm run deploy | Deploy to GitHub Pages |
๐ Development Serverโ
npm run start
Visit: http://localhost:3000/mcp-adr-analysis-server/
The site will auto-reload when you edit markdown files.
๐๏ธ Building for Productionโ
npm run build
Output: build/
directory (ready for deployment)
๐ข Deploymentโ
Automatic (GitHub Actions)โ
Push to main
branch - GitHub Actions will automatically:
- Build the Docusaurus site
- Deploy to GitHub Pages
- Available at: https://tosin2013.github.io/mcp-adr-analysis-server/
Manual Deploymentโ
npm run deploy
๐ Editing Documentationโ
File Structureโ
docs/
โโโ tutorials/ # Learning-oriented guides
โโโ how-to-guides/ # Problem-solving guides
โโโ reference/ # Technical reference
โโโ explanation/ # Understanding-oriented
โโโ ide-rules/ # IDE integration
Adding a New Pageโ
-
Create markdown file in appropriate directory:
touch tutorials/my-new-tutorial.md
-
Add front matter:
---
id: my-new-tutorial
title: My New Tutorial
sidebar_label: New Tutorial
sidebar_position: 4
--- -
Add to
sidebars.js
if needed:'tutorials/my-new-tutorial',
Markdown Featuresโ
Code Blocks with Syntax Highlightingโ
interface MyInterface {
name: string;
value: number;
}
Admonitionsโ
:::note
This is a note
:::
:::tip
This is a tip
:::
:::warning
This is a warning
:::
:::danger
This is dangerous
:::
Mermaid Diagramsโ
```mermaid
graph TD
A[Start] --> B[Process]
B --> C[End]
```
Tabsโ
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs>
<TabItem value="npm" label="npm" default>
npm install
</TabItem>
<TabItem value="yarn" label="Yarn">
yarn install
</TabItem>
</Tabs>
๐จ Customizationโ
Theme Colorsโ
Edit src/css/custom.css
:
:root {
--ifm-color-primary: #646cff;
/* Change to your brand color */
}
Logo and Imagesโ
- Logo:
static/img/logo.png
- Favicon:
static/img/favicon.ico
- OG Image:
static/img/og-image.png
Navigationโ
Edit docusaurus.config.js
:
navbar: {
items: [
// Add your nav items
],
}
Sidebarโ
Edit sidebars.js
:
{
type: 'category',
label: 'My Section',
items: ['doc1', 'doc2'],
}
๐ Search Configurationโ
Local Search (Default)โ
Already configured - works out of the box.
Algolia Search (Recommended for Production)โ
- Sign up at https://docsearch.algolia.com/
- Get your API keys
- Update
docusaurus.config.js
:
algolia: {
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_API_KEY',
indexName: 'mcp-adr-analysis-server',
}
๐ Troubleshootingโ
Port Already in Useโ
npm run start -- --port 3001
Build Errorsโ
# Clear cache and rebuild
npm run clear
npm run build
Module Not Foundโ
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
Broken Linksโ
Docusaurus will warn about broken links during build. Fix them by:
- Using relative paths:
/tutorials/my-doc
- Checking file exists in docs directory
- Updating
onBrokenLinks
in config (not recommended)
๐ Resourcesโ
โ Verification Checklistโ
After setup, verify:
- Dev server starts:
npm run start
- All pages load correctly
- Navigation works
- Search works
- Mermaid diagrams render
- Code blocks have syntax highlighting
- Production build succeeds:
npm run build
- GitHub Actions workflow exists:
.github/workflows/deploy-docusaurus.yml
๐ You're Ready!โ
Your Docusaurus documentation site is now set up and ready to use. Start the dev server and begin editing your documentation!
npm run start
Need Help? Check the full migration guide or Docusaurus documentation.