MkDocs Setup (Windows + VS Code + Material Theme)
This document describes the exact steps used to set up MkDocs with the Material theme on Windows, using VS Code, a Python virtual environment, and deployment to GitHub Pages.
It also documents common Windows-specific issues and their solutions.
1️⃣ Project Structure
We use a standard MkDocs layout:
notes/
├── mkdocs.yml
├── .gitignore
├── requirements.txt
├── venv/
└── docs/
├── index.md
├── articles/
├── projects/
├── code/
├── notebooks/
└── assets/
notes/→ Git repository rootdocs/→ All public Markdown contentsite/→ Generated HTML (ignored by Git)
2️⃣ Create and Activate a Virtual Environment
From the notes/ folder:
Activate it:
PowerShell / CMD
Git Bash
3️⃣ Install MkDocs and Plugins
Install MkDocs and required plugins:
Verify installation:
4️⃣ Create mkdocs.yml
Place mkdocs.yml in the root (notes/), not inside docs/.
Minimal working configuration:
site_name: Florin Neagu Projects & Notes
site_url: https://SomeLameCode.github.io/mkdocs-blog/
site_description: Technical notes, projects, and articles
site_author: Florin Neagu
repo_url: https://github.com/SomeLameCode/mkdocs-blog
theme:
name: material
palette:
primary: indigo
accent: indigo
features:
- navigation.tabs
- navigation.sections
- content.code.copy
plugins:
- search
- mermaid2
- git-revision-date-localized:
fallback_to_build_date: true
docs_dir: docs
site_dir: site
5️⃣ Navigation Strategy (Flexible)
Do not reference files that don’t exist yet.
Start minimal:
Add sections later as content matures.
MkDocs will still build pages not listed in nav.
6️⃣ Run the Local Development Server
From notes/:
Open in browser:
7️⃣ Windows Auto-Reload Caveat (Important)
On Windows, MkDocs auto-reload may NOT work when run from Git Bash.
Recommended solution
Run MkDocs from PowerShell or CMD instead of Git Bash:
This reliably enables live reload when saving .md files.
Even with
watchdoginstalled, Git Bash may not emit filesystem events correctly.
8️⃣ VS Code Recommendations
Install: - YAML Language Support by Red Hat
Optional VS Code settings (JSON):
This improves compatibility with file watchers.
9️⃣ .gitignore
Create .gitignore in notes/:
# MkDocs build output
site/
# Virtual environment
venv/
# Python cache
__pycache__/
*.pyc
# VS Code
.vscode/
# OS files
Thumbs.db
.DS_Store
10️⃣ Initialize Git and Push Source Content
From notes/:
git init
git remote add origin https://github.com/SomeLameCode/mkdocs-blog.git
git branch -M main
git add .
git commit -m "Initial MkDocs setup"
git push -u origin main
This pushes:
- Markdown content
- mkdocs.yml
- configuration files
It does NOT push the generated site.
11️⃣ Deploy to GitHub Pages
MkDocs handles deployment automatically:
This:
1. Builds the site
2. Pushes it to the gh-pages branch
3. Publishes it via GitHub Pages
Your site becomes available at:
12️⃣ Ongoing Workflow
When you make changes:
You don’t need to commit the
site/folder;gh-deployhandles it automatically.
Key Takeaways
docs/= contentmkdocs.yml= configurationsite/= generated output (never commit)- Use PowerShell/CMD for reliable live reload on Windows
- Keep
navminimal early, expand later
This setup is stable, boring, and production-ready.