Minimal Static Blog Generator in Python
Simple static blog generator, written in Python, with the top Lighthouse scores.
Missing 'Best Practices' and 'SEO' due to server-side configuration.
Features
- Minimal website size (9 KB pretty, 2 KB minified)
- Simplicity
- No JavaScript
- Looks
greatgood on desktop and mobile - Very easy to modify styles (assets/blog.css)
- Simple HTML templating using Python's
str.format(...)
Screenshots
Usage
- Add posts to
posts/
- Run:
python generate_static_blog.py
- See results in
public/blog/
Optional - Here's an easy way to deploy to a server (assuming you have npm installed):
- Run:
npx surge public/blog my-blog.surge.sh
Note: You will need to change the sub-domain of the '*.surge.sh' URL
Improvement ideas
- Rather than a using a custom parser for the front matter, use
pip install fronmatter
- More error catching (and better error messages)
- Potentially use extensions for the markdown library: https://python-markdown.github.io/extensions/