April 27, 2025
Dynamic static websites
“A static website? No way, I don’t want that.” I get that. ‘Static’ sounds boring, unchangeable, and passive.
A static website cannot change at any moment. It can only change if the owner actively updates the website (by adding new text or new images). That might sound a lot less “unchangeable” than you initially thought. Because when else would you want a website to change?
Well.. the best example I can think of is Facebook’s ever-changing timeline. But that’s not a website, that’s social media. The only valid example I can think of is a comment section under a news article, but that’s very 2010… but, to be fair: technically impossible on a static website.
However, I sometimes do get requests to add dynamic components to static websites. Usually, it’s about a list of current job openings, loaded from another website, or a login for members. Fortunately, you can easily add those kinds of things to a static website. You should use APIs for that, according to the internet. But that’s not the only option. There is an easier alternative. With Hugo, Apache, and PHP, you can create virtually any dynamic functionality with just a few lines of code.
A login for members? That can be done with a simple .htaccess file. A password forgotten option? A few lines of PHP that call a transactional mailer and you are done… and those job openings? You can simply fetch them with a GetRemote call in Hugo. Using a cron job, you can determine how often you want them to be refreshed. Easy-peasy. This way, you make your static website dynamic with just a few lines of code.
So, my static websites are only dynamic where and when it is truly necessary. And that has a big advantage: it makes them cheaper, safer, faster, and better for the environment.
Want to know more? Send me an email. I’d love that.
() Joost van der Schee