A bare-bones, Python-based static site generator that converts markdown content into HTML without breaking a sweat (or doing anything fancy). This project was developed as part of Lane Wagner's Static Site Generator course on Boot.dev, where he describes it as a "Grug-brain" static site generator - because sometimes, the simplest solution is just to bash two rocks together until a website comes out.
src/
- Core Python source codecontent/
- Markdown content filesstatic/
- Static assets (CSS, images)template.html
- HTML template for page generation- Test files for each component
- Entry point that orchestrates the site generation
- Handles directory setup and cleanup
- Manages file copying and page generation
- Ultra-basic markdown parsing functionality
- Supports:
- Headings (H1-H6)
- Code blocks
- Blockquotes
- Ordered and unordered lists
- Links and images
- Inline formatting (bold, italic)
textnode.py
- Base text processinghtmlnode.py
- HTML element representationleafnode.py
- Terminal HTML elementsparentnode.py
- Container HTML elements
- Simple template with
{{ Title }}
and{{ Content }}
placeholders - External CSS support
- Hierarchical content structure in
content/
- Supports nested directories
- Index-based navigation
- Markdown files with rich formatting
- Finds markdown files in folders (even nested ones, wow!)
- Copies your CSS and images without losing them
- Turns markdown into HTML
- Uses one template for all pages (why complicate things?)
- Makes URLs that humans can actually read
- Has tests (because even Grug knows testing is good)
Tests are located in the tests/
directory and can be run using:
./test.sh
This project uses GitHub Actions for CI. The workflow:
- Runs on every push to main and pull requests
- Sets up Python 3.10
- Installs dependencies including pytest
- Runs the test suite
You can view the test results in the Actions tab of the GitHub repository.
I am attempting to follow good Python practices as I learn about them, and I will continue to come back and refine this toy project if I get inspired 😄