Scaffolding New Projects
Doom provides a powerful scaffolding system that helps you create new documentation projects from templates. This guide walks you through using thedoom new command to bootstrap your documentation.
Quick Start
Run the scaffolding command
Use the This will use the default
doom new command to start the scaffolding wizard:product-doc template.Select a scaffolding type
The wizard will present you with available scaffolding types:Choose the one that best fits your project needs.
Answer the prompts
The wizard will ask for project-specific information:
- Project name
- Description
- Default language
- Features to enable
Available Templates
Product Documentation Template
The defaultproduct-doc template includes:
- Bilingual support (English and Chinese)
- Basic directory structure
- Configuration file (
doom.config.yml) - Sample documentation pages
- Package.json with scripts
Specifying Template Type
You can skip the interactive prompt by specifying the template type directly:[template-name]:[type]
Using Cached Templates
Doom caches downloaded templates locally to speed up scaffolding. Templates are fetched from the configured repository (default:alauda-public/product-doc-guide).
Force Update Templates
To fetch the latest template version, use the--force flag:
- Download the latest template from the remote repository
- Bypass the local cache
- Ensure you’re using the most recent scaffolding
The
--force option is useful when template updates are available or when your cached version is corrupted.Template Configuration
Templates are defined in ascaffolding.yaml file at the template repository:
Generated Project Structure
A typical scaffolded project looks like this:Key Files
doom.config.yml
doom.config.yml
The main configuration file for your documentation site:
docs/ directory
docs/ directory
Contains all your documentation content:
en/- English documentationzh/- Chinese documentationpublic/- Static assets (images, files)shared/- Reusable components and content
package.json
package.json
Includes helpful npm scripts:
Next Steps
After scaffolding your project:Start Development
Launch the dev server with
doom devConfigure Your Site
Customize configuration and appearance
Add Content
Start writing documentation pages
Deploy
Learn deployment strategies
Troubleshooting
Template not found error
Template not found error
If you see a “Template not found” error:Try using the
--force flag to download the latest templates:Unable to resolve scaffoldings
Unable to resolve scaffoldings
If scaffolding fails to load:
- Check your internet connection
- Verify the repository is accessible
- Remove local cache and retry:
EJS template errors
EJS template errors
If you encounter template rendering errors:
- Ensure all required parameters are provided
- Check that parameter names match the template expectations
- Review the
scaffolding.yamlconfiguration for typos
Custom Templates
You can create custom templates for your organization. A template consists of:- Template repository - Git repository containing template files
- scaffolding.yaml - Configuration defining parameters and layout
- Template files - Files and directories to be copied
Example Custom Template
README.md.ejs:
productName="My Product" and version="2.0", it generates: