Quick Start
Get up and running with EmberDocs in 5 minutes. This guide covers everything you need to start creating documentation.
Prerequisites
Before you begin, ensure you have:
- Node.js 18.0 or higher - Check with
node --version - npm or yarn - Check with
npm --version - Git - For cloning the repository
1. Clone and Install
# Clone the EmberDocs repository
git clone https://github.com/sturdy-barnacle/emberdocs.git
cd emberdocs
# Install dependencies
npm install
# Copy environment template
cp .env.example .env.local2. Configure Environment Variables
Edit .env.local to customize your documentation site:
# Branding (optional but recommended)
EMBERDOCS_PRODUCT_NAME=My Documentation
EMBERDOCS_COMPANY_NAME=My Company, Inc.
EMBERDOCS_DEFAULT_AUTHOR=Your Name
# Logo (optional)
EMBERDOCS_LOGO_PATH=/logos/my-logo.png
# Navigation links (optional)
EMBERDOCS_HEADER_LINKS={"Docs": "/docs", "Features": "/#features", "GitHub": "https://github.com/yourorg"}
# Footer (optional)
EMBERDOCS_FOOTER_TEXT=My Company Ā© 2025
EMBERDOCS_FOOTER_LINKS={"Privacy": "/privacy", "Terms": "/terms"}
# Custom documentation path (default: docs/examples)
# EMBERDOCS_CONTENT_DIR=docs/content
# Custom base route (default: /docs)
# EMBERDOCS_BASE_ROUTE=/documentationImportant: After editing .env.local, restart your dev server for changes to take effect.
3. Create Your First Document
By default, EmberDocs looks for documentation in docs/examples/. Create your first document:
# Create the directory if it doesn't exist
mkdir -p docs/examples
# Create your index page
touch docs/examples/index.mdEdit docs/examples/index.md:
---
title: "Welcome to My Documentation"
slug: "index"
date: "2026-01-02"
published: true
order: 0
---
# Welcome to My Documentation
This is your documentation homepage. You can write in standard Markdown.
## Features
- **Fast** - Static generation for instant page loads
- **Searchable** - Full-text search powered by FlexSearch
- **Beautiful** - Dark mode support with modern design
- **Flexible** - Organize content in folders with automatic navigation
## Getting Started
1. Add more markdown files to `docs/examples/`
2. Organize them in folders
3. Navigation is generated automatically
4. Use frontmatter to control ordering and metadata
## Next Steps
- Read the [Installation Guide](/docs/getting-started/installation)
- Learn [Basic Usage](/docs/guides/basic-usage)
- Explore [Customization](/docs/guides/customization)Understanding Frontmatter
Every markdown file needs YAML frontmatter at the top (between --- delimiters). Here's what each field does:
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
title | ā Yes | string | Display title shown in page and navigation | "Getting Started" |
slug | ā Yes | string | URL-safe identifier (usually matches file path) | "getting-started" |
published | ā No | boolean | Include in navigation (default: true) | true or false |
date | ā No | string | Publication date (ISO format) | "2025-01-15" |
tags | ā No | array | Tags for categorization | ["guide", "tutorial"] |
order | ā No | number | Sort order in sidebar (lower = first) | 1, 2, 3 |
author | ā No | string | Document author (falls back to EMBERDOCS_DEFAULT_AUTHOR) | "John Doe" |
Important: The slug field should match your file path structure:
- File:
docs/examples/getting-started.mdā slug:"getting-started" - File:
docs/examples/guides/basic-usage.mdā slug:"guides/basic-usage" - File:
docs/examples/guides/advanced/index.mdā slug:"guides/advanced"(not"guides/advanced/index")
Complete frontmatter example:
---
title: "Complete Guide to EmberDocs"
slug: "guides/complete-guide"
date: "2026-01-02"
tags: ["guide", "tutorial", "advanced"]
published: true
order: 5
author: "Jane Smith"
---
# Your content here4. Start the Development Server
npm run devOpen http://localhost:3000 in your browser. You'll see your documentation!
Note: The root route (/) redirects to /docs/index by default. To show the EmberDocs marketing landing page instead, set EMBERDOCS_SHOW_LANDING=true in .env.local.
Search Index: The search index is automatically built during production builds (npm run build). For development, you can manually build it with npm run build:search if needed, but it's not required to get started.
5. Add More Documents
Create additional markdown files in docs/examples/:
# Create a getting started guide
touch docs/examples/getting-started.mdEdit docs/examples/getting-started.md:
---
title: "Getting Started"
slug: "getting-started"
date: "2026-01-02"
published: true
order: 1
---
# Getting Started
This is a new documentation page!
## What You Can Do
- Write in Markdown
- Use code blocks with syntax highlighting
- Create links to other pages
- Organize content in folders
## Markdown Features
EmberDocs supports all standard Markdown plus GitHub Flavored Markdown (GFM):
### Code Blocks
\`\`\`typescript
function greet(name: string): string {
return `Hello, ${name}!`;
}
\`\`\`
### Tables
| Feature | Status | Notes |
|---------|--------|-------|
| Search | ā
| FlexSearch powered |
| Dark Mode | ā
| Auto-detects preference |
| Versioning | š§ | Coming soon |
### Blockquotes
> This is a blockquote. Use it for callouts, warnings, or important notes.
### Links
- [Internal link](/docs/getting-started/installation)
- [External link](https://example.com)
- [Link with text](https://example.com "Hover text")
### Images

### Task Lists
- [x] Completed task
- [ ] Incomplete task
- [x] Another completed taskThe page will automatically appear in the sidebar navigation. The URL will be /docs/getting-started (based on the slug field).
6. Organize with Folders
Create folders to organize your documentation:
# Create a guides folder
mkdir -p docs/examples/guides
# Create an index.md for the folder
touch docs/examples/guides/index.md
# Create a guide
touch docs/examples/guides/basic-usage.mdEdit docs/examples/guides/index.md:
---
title: "Guides"
slug: "guides"
date: "2026-01-02"
published: true
order: 2
---
# Guides
This is the guides section. All guides are listed here.Important: When you create a folder with an index.md file:
- The URL is
/docs/guides(not/docs/guides/index) - The
slugin frontmatter should be"guides"(not"guides/index") - The folder appears as a collapsible section in the sidebar
- All files in the folder appear as children in the navigation
Example folder structure:
docs/examples/
āāā index.md # /docs/index
āāā getting-started.md # /docs/getting-started
āāā guides/
ā āāā index.md # /docs/guides
ā āāā basic-usage.md # /docs/guides/basic-usage
ā āāā advanced/
ā āāā index.md # /docs/guides/advanced
ā āāā features.md # /docs/guides/advanced/featuresThe folder structure automatically creates navigation hierarchy in the sidebar.
7. Use Search
Search is built-in and works automatically:
- Press
āK(Mac) orCtrl+K(Windows/Linux) to open the search palette - Type your query
- Results appear instantly with excerpts
- Click a result to navigate to that page
The search index is built from all your markdown files and includes:
- Document titles
- Body content
- Headings
- Excerpts for preview
8. Customize Sidebar Order
Control the order of items in the sidebar using the order field in frontmatter:
---
title: "First Page"
order: 1
---
# First Page---
title: "Second Page"
order: 2
---
# Second PageSorting rules:
- Items with
ordervalues are sorted numerically (lower numbers first) - Items without
orderare sorted alphabetically after ordered items - Folders always appear before documents in the same parent
9. Customize Your Branding
Add Your Logo
- Place your logo in
public/logos/my-logo.png - Set in
.env.local:bashEMBERDOCS_LOGO_PATH=/logos/my-logo.png - Restart the dev server
Supported formats: PNG, SVG, JPG
Display size: 28x28 pixels (larger images are scaled)
Best format: SVG for crisp display
Change Product/Company Name
EMBERDOCS_PRODUCT_NAME=My Awesome Product
EMBERDOCS_COMPANY_NAME=My Company, Inc.Customize Navigation
EMBERDOCS_HEADER_LINKS={"Docs": "/docs", "Blog": "/blog", "GitHub": "https://github.com/yourorg"}Add Footer
EMBERDOCS_FOOTER_TEXT=My Company Ā© 2025
EMBERDOCS_FOOTER_LINKS={"Privacy": "/privacy", "Terms": "/terms"}See the Customization Guide for detailed instructions.
Common Tasks
Add a New Page
- Create a new
.mdfile indocs/examples/(or your custom content directory) - Add frontmatter with required fields:
markdown
--- title: "Page Title" slug: "page-slug" published: true --- - Write your content in Markdown
- Save and refresh your browser - the page appears automatically!
Create Nested Folders
# Create nested structure
mkdir -p docs/examples/guides/advanced
# Add index.md to the folder
touch docs/examples/guides/advanced/index.mdThe URL will be /docs/guides/advanced (without /index).
Change Documentation Path
If you want to use a different folder for your docs:
# In .env.local
EMBERDOCS_CONTENT_DIR=docs/contentThen rebuild the search index:
npm run build:searchChange Base Route
To serve docs at a different URL path:
# In .env.local
EMBERDOCS_BASE_ROUTE=/documentationNow your docs will be at /documentation/* instead of /docs/*.
Enable Dark Mode
Dark mode is built-in and automatically detects system preference. Users can toggle it using the theme toggle button in the header.
To force dark mode programmatically:
document.documentElement.setAttribute('data-theme', 'dark');Project Structure
emberdocs/
āāā docs/
ā āāā examples/ # Your documentation files (default)
ā āāā index.md # Homepage
ā āāā getting-started/
ā āāā guides/
āāā src/
ā āāā app/ # Next.js App Router
ā ā āāā docs/ # Documentation routes
ā āāā lib/ # Core functionality
ā ā āāā content.ts # Markdown parsing
ā ā āāā search.ts # Search indexing
ā ā āāā navigation.ts # Sidebar generation
ā āāā components/ # React components
āāā public/ # Static assets (logos, etc.)
āāā .env.local # Your configuration (not committed)
āāā package.json # Dependencies and scriptsAvailable Commands
| Command | Purpose | When to Use |
|---|---|---|
npm run dev | Start development server | Daily development |
npm run build | Build for production (includes search index) | Before deployment |
npm run build:search | Build search index only | After adding/changing docs |
npm run start | Start production server | Test production build locally |
npm run lint | Check code style | Before committing |
npm run format | Auto-fix code formatting | When lint fails |
npm run typecheck | TypeScript type checking | Before committing |
npm test | Run tests | Before committing |
npm run check | Run all checks (lint + typecheck + test) | Before pushing to GitHub |
Development workflow:
# Start dev server
npm run dev
# In another terminal, add/edit documentation files
# Then rebuild search index if needed
npm run build:search
# Before committing, run full check
npm run checkTroubleshooting
Search doesn't work
Symptoms: Search palette opens but shows "No results" or doesn't open at all.
Solution: Build the search index:
npm run build:searchVerify: Check that public/search-index.json exists and has content.
Note: The search index is automatically built during npm run build, but for development you may need to build it manually after adding new documents.
Changes to .env.local don't appear
Solution: Restart your dev server. Environment variables are only loaded at startup:
# Stop server (Ctrl+C)
npm run devWhy: Next.js reads environment variables when the server starts, not on file changes.
Page shows 404
Possible causes:
- File doesn't exist in
docs/examples/(or your custom content directory) - Frontmatter
slugdoesn't match the file path published: falsein frontmatter (page is hidden)- Search index needs rebuilding
- File path doesn't match URL structure
Solution:
- Check file exists:
ls docs/examples/your-file.md - Verify frontmatter
slugmatches expected URL:- File:
docs/examples/guides/basic.mdā slug:"guides/basic" - File:
docs/examples/guides/advanced/index.mdā slug:"guides/advanced"
- File:
- Check
published: truein frontmatter - Rebuild search index:
npm run build:search - Restart dev server
- Check browser console for errors
Sidebar order is wrong
Solution: Add order field to frontmatter:
---
title: "My Page"
order: 1
---Sorting rules:
- Lower numbers appear first
- Items without
orderare sorted alphabetically after ordered items - Folders always appear before documents in the same parent
- Within each group (ordered vs. unordered), the respective sorting applies
Logo doesn't show
Checklist:
- ā
File exists in
public/folder (e.g.,public/logos/my-logo.png) - ā
Path in
.env.localstarts with/(e.g.,/logos/my-logo.png) - ā
File name uses lowercase, no spaces (e.g.,
my-logo.pngnotMy Logo.png) - ā
Dev server was restarted after editing
.env.local - ā File format is PNG, SVG, or JPG
- ā Check browser console for 404 errors
Navigation not updating
Symptoms: New files don't appear in sidebar after creating them.
Solution:
- Ensure file has valid frontmatter with
titleandslug - Check
published: true(or omit it, defaults totrue) - Restart dev server:
npm run dev - Hard refresh browser (Cmd+Shift+R / Ctrl+Shift+R)
Build fails
Common errors:
"Cannot find module 'flexsearch'"
npm install flexsearch"Document path not found"
- Check file paths are correct
- Ensure files have
.mdextension - Verify frontmatter is valid YAML
"Build timeout"
- Increase timeout in
next.config.js:
export default {
staticPageGenerationTimeout: 300, // seconds
};TypeScript errors
Solution:
# Check for type errors
npm run typecheck
# Clear Next.js cache
rm -rf .next
# Rebuild
npm run buildPort already in use
Solution: Use a different port:
npm run dev -- -p 3001Or kill the process using port 3000:
# Find process
lsof -ti:3000
# Kill it
kill -9 $(lsof -ti:3000)Next Steps
- Learn the basics: Basic Usage Guide
- Customize everything: Customization Guide
- Explore the API: API Reference
- Get help: Troubleshooting Guide
Deployment
Deploy to Vercel
- Push your code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on every push
Required environment variables in Vercel:
- All your
.env.localvariables (except secrets) EMBERDOCS_CONTENT_DIR(if custom)EMBERDOCS_BASE_ROUTE(if custom)
Deploy to Netlify
- Push your code to GitHub
- Import project in Netlify
- Build command:
npm run build - Publish directory:
.next - Add environment variables in Netlify dashboard
Self-Hosted Deployment
# Build for production
npm run build
# Start production server
npm run startProduction considerations:
- Set
NODE_ENV=production - Use a process manager (PM2, systemd)
- Set up reverse proxy (nginx, Caddy)
- Configure SSL/TLS certificates
- Set up monitoring and logging
Build Optimization
Before deploying, optimize your build:
# Test production build locally
npm run build
npm run startNote: For bundle size analysis, you can use @next/bundle-analyzer (not included by default). Install it separately if needed.
Tips:
- Keep images optimized (use Next.js Image component)
- Minimize dependencies
- Use dynamic imports for heavy components
- Enable compression in your server
Understanding URLs and File Paths
EmberDocs maps file paths to URLs automatically:
| File Path | Frontmatter Slug | URL |
|---|---|---|
docs/examples/index.md | "index" | /docs/index |
docs/examples/getting-started.md | "getting-started" | /docs/getting-started |
docs/examples/guides/index.md | "guides" | /docs/guides |
docs/examples/guides/basic-usage.md | "guides/basic-usage" | /docs/guides/basic-usage |
docs/examples/guides/advanced/index.md | "guides/advanced" | /docs/guides/advanced |
docs/examples/guides/advanced/features.md | "guides/advanced/features" | /docs/guides/advanced/features |
Key rules:
- The
slugshould match the file path relative to your content directory - Folders with
index.mduse the folder name as the slug (notfolder/index) - URLs are always lowercase and use forward slashes
- Special characters in filenames should be avoided (use hyphens instead)
Markdown Best Practices
Headings
Use proper heading hierarchy (H1 ā H2 ā H3):
# Main Title (H1 - only one per page)
## Section (H2)
### Subsection (H3)
#### Detail (H4)Code Blocks
Always specify language for syntax highlighting:
\`\`\`typescript
// TypeScript code
\`\`\`
\`\`\`bash
# Shell commands
\`\`\`
\`\`\`json
{
"key": "value"
}
\`\`\`Links
Use relative paths for internal links:
ā
Good: [Installation](/docs/getting-started/installation)
ā Bad: [Installation](http://localhost:3000/docs/getting-started/installation)Images
Place images in public/ and reference with absolute paths:
Tables
Use tables for structured data:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |Need Help?
- Setup issues: Check the Installation Guide
- Configuration: Review Configuration Reference for all options
- Usage questions: Read Basic Usage Guide
- Customization: See Customization Guide
- Troubleshooting: Check Troubleshooting Guide
- Search: Use
āK/Ctrl+Kto search the docs - GitHub: Visit the GitHub repository for issues and discussions