Skip to content

olivierphi/devblog

Repository files navigation

What could be more pleasant than totally over-engineering your devblog resume when you're a Web Developer in 2024? πŸ˜„

Just because I love buidling that kind of stuff, rather than using a turnkey solution to generate that bunch of static HTML files I opted for... a Django-based setup!

So, in order to generate only a few HTML pages from Markdown sources, I had the pleasure to use all these wonderful technologies: ✨

  • A Django project that parses my post in Markdown format, using Python Markdown and PyMdown Extensions.
  • Pico.css for the base styling.
  • DOMinate for the templating (the closest thing to JSX I could find in Python πŸ™‚).
  • Live reloading in the browser, powered by django-browser-reload.
  • Once the static files are generated via a custom command, they are deployed to GitHub Pages via ghp-import.
  • A GitHub Action builds and deploys the static assets automatically on every push to the branch.

On top of that I've also used some classic Python and Django packages, such as:

Is it really over-engineered?

$ ls -l .venv/lib/python3.12/site-packages/*/METADATA | wc -l
48

Probably is! ✌ πŸ˜…

Usage

All is needed is the venerable-and-ubiquitous Make and Python 3.12 (via pyenv for instance).

$ pyenv use 3.12
$ make install # will create a virtual env in ".venv/"
$ make dev # starts the Django server on port 8000, with live reloading

To build the static assets (HTML, CSS, images...)

$ make build

In the CI pipeline powered by GitHub Actions, the whole process (installing the dependencies, building the static Web assets, and pushing all these static files to the gh-pages branch) takes about 40 seconds which is not too bad. πŸ™‚

LICENSE

The code of this app is licensed under the MIT license.

About

My devblog πŸ’» πŸ™‚

Topics

Resources

License

Stars

Watchers

Forks