A guided project from Boot.dev where you'll build your own static site generator from scratch in Python—learning core principles of OOP and functional programming along the way.
This project is designed as a guided learning experience rather than a production-ready SSG. You'll learn by implementing:
- Parsing of content files (Markdown, HTML)
- Applying templates (e.g., via HTML templates like
template.html) - Building a basic development server (
server.py) - Automating generation through shell scripts (
build.sh,main.sh) - Validating output with tests (
test.sh) - Organizing assets in a
static/directory
- Python 3.7+
- A terminal or shell environment (macOS/Linux/WSL or PowerShell/Command Prompt on Windows)
- Optional: A modern code editor (e.g., VS Code) for ease of editing and running scripts
-
Clone the repository:
git clone <repository-url> cd <your-project>
-
Install any dependencies (if specified in src/requirements.txt, otherwise just proceed).
- Write your content in content/—this might include Markdown or HTML files.
- Build command (./build.sh or ./main.sh) runs the generator:
- Reads content/, processes with logic from src/
- Wraps content with template.html
- Copies static files from static/ to the output directory (e.g., dist/)
- View locally with python server.py—often hosting at http://localhost:8000
- Run tests via ./test.sh to ensure everything works as expected.
to build and preview the site
./build.sh
python server.py
# Navigate to: http://localhost:8000to run tests
./test.sh