What could be more pleasant than totally over-engineering your online resume when you're a Web Developer in 2024? 😄
Here is the history of this traditionally over-engineered CV project:
- The very first version was using Node.js, CoffeeScript, Vagrant and gulp (2013! ⌛).
- The second version, in 2016, was written in goold ol' PHP.
- The third one, in 2017, was built with isomorphic React as I was in the process of getting up to speed with React.
- After that I wanted to give Vue.js a shot, so in 2018 I wrote an isomorphic Vue.js version. I wasn't a huge fan of Vue.js in the end, but I still kept that version running for a few years.
Well, for this 5th flavour I opted for... a Django-based setup!
So, in order to generate only 2 HTML pages and 2 PDF files, I had the pleasure to use all these wonderful technologies: ✨
- A Django project that parses my resume data (stored in TOML format, now readable by Python's own standard library 💚) and inject it into HTML templates.
- Live generation of the CSS file, powered by Tailwind - without any dependency on Node.js, thanks to django-tailwind-cli.
- Live reloading in the browser, powered by django-browser-reload.
- Automatic local copy of Google Fonts, thanks to django-google-fonts. (see Public CDNs Are Useless and Dangerous or The Court Says, Don’t Use Google Fonts for the rationale behind it)
- PDF files are generated from the static Web assets, via Playwright.
- All these static files are deployed to GitHub Pages by 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:
$ ls -l .venv/lib/python3.12/site-packages/*/METADATA | wc -l
64
Yes it is! ✌ 😅
To be fair, there are 8 direct "dev dependencies" to manage things such as live reloading or code quality, but only 5 direct packages are actually needed to build and deploy the project from scratch in the GitHub Actions pipeline. So I imagine that the amount of third-party code installed there should be more reasonable...
Alright, let's check that locally:
$ python -m venv .venv-ci --prompt .venv-ci
$ source .venv-ci/bin/activate
(.venv-ci) $ pipx run poetry==1.8.3 install --no-root --only=main,deployment
(.venv-ci) $ ls -l .venv-ci/lib/python3.12/site-packages/*/METADATA | wc -l
20 # better! 😌
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, PDF versions...)
$ make build-and-create-pdfs
In the CI pipeline powered by GitHub Actions, the whole process
(installing the dependencies, building the static Web assets, generating the PDF files, and pushing all these static files to the gh-pages
branch)
takes about 40 seconds which is not too bad. 🙂
Excepted files in the myresume/staticfiles/img
folder (I don't have any rights on them, as it's just images found via search engines that I cropped and resized),
this app is licensed under the MIT license.