This directory contains the documentation for the homelab using MkDocs.
- Python 3.8+
- pip (Python package manager)
# Install dependencies
pip install -r requirements.txt
# Build static site
mkdocs build
# View site locally (development server)
mkdocs serve
# Access at: http://localhost:8000docs/
├── index.md # Homepage
├── getting-started/ # Setup guides
├── services/ # Service documentation
├── admin/ # Administration guides
├── troubleshooting.md # Common issues
├── faq.md # Frequently asked questions
└── SERVICE-TEMPLATE.md # Template for new services
-
Copy the template:
cp docs/services/SERVICE-TEMPLATE.md docs/services/category/new-service.md
-
Edit the new file with service details
-
Update
mkdocs.ymlnavigation:nav: - Services: - Category: - New Service: services/category/new-service.md
-
Build and test:
mkdocs serve
-
Create the file:
touch docs/admin/new-guide.md
-
Add content following other admin guides
-
Update
mkdocs.yml:- Administration: - New Guide: admin/new-guide.md
All pages are Markdown files (.md):
# Heading 1
## Heading 2
### Heading 3
**Bold** and *italic*
- Bullet point
- Another point
1. Numbered
2. List items
[Link text](url)
![][image.png](url or local path)```bash
docker compose up -d
```
```python
print("Hello")
```| Column 1 | Column 2 |
|----------|----------|
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4 |!!! note
This is a note
!!! warning
This is a warning
!!! tip
This is a helpful tip
!!! danger
This is dangerous- Push to GitHub
- Go to repository Settings → Pages
- Select "Deploy from a branch"
- Choose branch (main/master) and folder (/root)
- Wiki auto-builds and deploys
Requires: gh-pages branch setup (build locally, push compiled site)
Serve from your homelab:
-
Build site:
mkdocs build
-
Serve with simple HTTP server:
cd site python -m http.server 8000 -
Access:
http://localhost:8000 -
Docker container (optional):
FROM python:3.11-slim COPY requirements.txt . RUN pip install -r requirements.txt COPY . /docs WORKDIR /docs CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
Add to your homelab:
services:
wiki:
build:
context: .
dockerfile: docs/Dockerfile
container_name: homelab-wiki
restart: unless-stopped
ports:
- "8080:8000"
volumes:
- ./docs:/docs
networks:
- homelab-netDeploy:
docker compose -f wiki.compose.yml up -dAccess: http://localhost:8080
Create .github/workflows/deploy-wiki.yml:
name: Deploy Wiki
on:
push:
paths:
- 'docs/**'
- 'mkdocs.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install -r requirements.txt
- run: mkdocs build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./siteEdit mkdocs.yml:
theme:
palette:
- scheme: default
primary: blue
accent: blueAvailable colors: red, pink, purple, indigo, blue, cyan, teal, green, lime, yellow, orange
Add to mkdocs.yml:
theme:
logo: assets/logo.png
favicon: assets/favicon.pngPlace files in docs/assets/
- ✅ Write clear, concise documentation
- ✅ Use headers to organize content
- ✅ Include code examples
- ✅ Add tables for quick reference
- ✅ Use admonitions for important info
- ✅ Keep related pages linked
- ✅ Update regularly
- ❌ Don't be overly verbose
- ❌ Don't assume reader expertise
- ❌ Don't mix multiple languages
# Install dependencies once
pip install -r requirements.txt
# Serve locally (auto-reloads on changes)
mkdocs serve
# Visit: http://localhost:8000
# Build for production
mkdocs build
# Output in: site/pip install mkdocs mkdocs-materialmkdocs serve -a 0.0.0.0:8001
# Use different port# Clear cache
rm -rf site/
mkdocs build --cleanFor MkDocs issues:
Happy documenting! 📚