Understanding Project Structure
Learn about the files and folders in your Mordoc project and how they work together to create your documentation site.
Understanding Project Structure
A Mordoc project has a clear, organized structure that separates content, configuration, and assets. Understanding this structure helps you efficiently manage and customize your documentation.
Project Overview
my-docs/
├── config/
│ ├── favicon.ico
│ ├── logo.png
│ ├── logo-dark.png
│ ├── sidenav.yaml
│ ├── site.json
│ └── styles/
│ ├── main.json
│ └── typography.json
├── content/
│ └── en/
│ ├── index.md
│ └── guides/
│ └── getting-started.md
├── public/
│ ├── images/
│ └── icons/
├── dist/
├── node_modules/
├── package.json
└── package-lock.jsonDirectory Breakdown
config/ - Configuration Files
The config/ directory contains all configuration for your documentation site.
Site Configuration
site.json - Global site settings:
{
"title": "My Documentation",
"description": "Documentation for my project",
"baseUrl": "https://docs.example.com",
"language": "en",
"defaultLocale": "en"
}| Field | Description |
|---|---|
title | Site title (appears in browser tab) |
description | Meta description for SEO |
baseUrl | Production URL for your documentation |
language | Primary language code (e.g., "en") |
Navigation Configuration
sidenav.yaml - Defines your site's navigation structure. See Side Navigation for details.
Branding Assets
logo.png: Logo displayed in light modelogo-dark.png: Logo displayed in dark modefavicon.ico: Browser tab icon
Styling Configuration
styles/main.json - Theme colors and component styles:
{
"colors": {
"primary": "#3b82f6",
"secondary": "#8b5cf6",
"background": "#ffffff",
"text": "#1f2937"
}
}styles/typography.json - Font settings and text styles:
{
"fontFamily": {
"body": "Inter, sans-serif",
"heading": "Inter, sans-serif",
"code": "Monaco, monospace"
}
}See the Configuration section for detailed customization options.
content/ - Documentation Content
The content/ directory contains all your markdown documentation files, organized by language.
Structure
content/
└── en/ # Language directory
├── index.md # Homepage
├── guides/ # Section folder
│ ├── intro.md
│ └── advanced.md
└── api/
└── reference.mdContent Organization Rules
- Language Folders: Each language gets its own folder (e.g.,
en/,es/,fr/) - Homepage:
index.mdin the language root is your site's homepage - Nested Folders: Create subdirectories to organize related content
- URL Mapping: File paths become URLs:
content/en/guides/intro.md→/guides/introcontent/en/api/reference.md→/api/reference
Parent Pages
For parent pages with children (like "Guides" that contains multiple sub-pages):
Option 1: Parent with Content
content/en/
├── guides.md # Parent page with content
└── guides/
├── intro.md # Child page
└── advanced.md # Child pageOption 2: Parent as Label Only
content/en/
└── guides/
├── intro.md # First child
└── advanced.md # Second childIn your sidenav.yaml, parent-only labels don't have a path field.
public/ - Static Assets
The public/ directory holds static files that are copied directly to the build output.
public/
├── images/
│ ├── diagram.png
│ └── screenshot.jpg
├── icons/
│ ├── feature-1.svg
│ └── feature-2.svg
└── downloads/
└── guide.pdfReferencing Public Assets
In your markdown, reference these files from the root:

{% card icon="/icons/feature-1.svg" %}
Feature description
{% /card %}
Download the [PDF guide](/downloads/guide.pdf)Do not put configuration files or logos in public/. Branding assets belong in config/.
dist/ - Build Output
The dist/ directory is auto-generated when you run npm run build. It contains the compiled static site ready for deployment.
dist/
├── index.html
├── guides/
│ └── intro/
│ └── index.html
├── assets/
│ ├── styles.css
│ └── main.js
└── images/Important: Never edit files in dist/ manually. They're regenerated on each build.
node_modules/ - Dependencies
Auto-generated folder containing npm packages. Don't modify or commit this to version control.
Configuration Files
package.json
Defines your project metadata and dependencies:
{
"name": "my-docs",
"version": "1.0.0",
"scripts": {
"dev": "mordoc dev",
"build": "mordoc build",
"preview": "mordoc preview"
},
"dependencies": {
"mordoc": "^1.0.0"
}
}package-lock.json
Locks dependency versions for consistent installations. Commit this file to version control.
File Naming Conventions
Markdown Files
- Use lowercase letters
- Separate words with hyphens:
getting-started.md - Avoid spaces and special characters
- Use descriptive names:
installation-guide.md(notguide1.md)
Asset Files
- Use descriptive names:
hero-banner.png - Keep names URL-friendly
- Group related assets in subdirectories
Best Practices
Content Organization
- Group Related Content: Use folders to organize topics
- Flat Structure: Avoid deeply nested folders (max 2-3 levels)
- Consistent Naming: Use a consistent naming pattern across files
- Logical Hierarchy: Mirror your navigation structure in folders
Version Control
Add a .gitignore file to exclude build artifacts:
node_modules/
dist/
.DS_Store
*.logMulti-Language Support
For multilingual documentation:
content/
├── en/
│ ├── index.md
│ └── guides/
├── es/
│ ├── index.md
│ └── guides/
└── fr/
├── index.md
└── guides/Each language should have identical folder structures for consistency.
Common Workflows
Adding a New Page
- Create markdown file in
content/en/ - Add frontmatter with title and description
- Write your content
- Update
config/sidenav.yamlto add navigation link - Save and view in development server
Adding New Assets
- Place files in appropriate
public/subdirectory - Reference with absolute path from root:
/images/file.png - Build will automatically copy to
dist/
Updating Styles
- Edit
config/styles/main.jsonortypography.json - Save and view changes in development server
- Build when satisfied with results
Now that you understand the structure, explore Syntax & Components to learn how to write rich documentation content.
Troubleshooting
Page Not Appearing
- Check file is in
content/en/directory - Verify file has
.mdextension - Ensure page is added to
sidenav.yaml - Check for syntax errors in frontmatter
Assets Not Loading
- Verify file exists in
public/directory - Check path starts with
/(e.g.,/images/file.png) - Ensure filename matches exactly (case-sensitive on some platforms)
- Rebuild the site:
npm run build
Build Errors
- Check all markdown files have valid frontmatter
- Verify
sidenav.yamlsyntax is correct - Ensure no circular references in navigation
- Clear
dist/and rebuild

