MkDocs Documentation Site Setup
This template includes a MkDocs documentation site that automatically deploys to GitHub Pages.
Enable GitHub Pages
After your first push to main:
-
Wait for workflow to complete:
-
Configure Pages:
- Go to Settings → Pages
- Source: "Deploy from a branch"
- Branch:
gh-pages, Folder:/ (root) -
Save
-
Access your site:
https://<username>.github.io/<repo-name>/
Note
GitHub Pages is free for public repos. Private repos require GitHub Pro, Team, or Enterprise.
Customize Your Site
Update Branding
Site name (mkdocs.yml):
Logo icon (mkdocs.yml):
Colors (docs/stylesheets/extra.css):
:root {
--md-primary-fg-color: #5517c0; /* Main */
--md-primary-fg-color--light: #8e5ee8; /* Hover */
--md-primary-fg-color--dark: #2d0a70; /* Active */
--md-accent-fg-color: #5517c0; /* Accent */
}
Add Your Documentation
- Create markdown files in
docs/ -
Add to navigation in
mkdocs.yml:
-
Preview locally:
File Structure
docs/
├── README.md # Home page
├── *.md # Guide docs
├── stylesheets/
│ └── extra.css # Custom theme
└── references/ # Reference docs
GitHub-style alerts work automatically:
Note
Informational callout example
Resources
- MkDocs Documentation
- Material for MkDocs - Theme and features
- Material Icons - Logo icons