Static Webpage Generation

I'm an advocate of static webpage generation, as the simplest way to implement many simple websites. Combined with modern version control, it is a truly elegant solution. And who doesn't admire elegance?

The Dynamic Website of Relational Data

I remember the glory days of, in the early naughts (2000s), when everyone was using a LAMP stack for every website they made. A few years prior, the ubiquitous guestbook had been a Perl script that appended content to a static HTML file. But with the wide adoption of PHP and MySQL, a guestbook would then be written in PHP, using a relational database to store the data.

Once you've learned how to use PHP and MySQL together, a combination that made feature-rich dynamic websites easy to make, it likely became your modus operandi.

Some engineers had justification to use LAMP when it wasn't necessary. Maybe your standard web framework included a relational DBMS like MySQL, making it a low-cost choice. Or maybe you have a planned feature set necessitating relational data, so you're avoiding data migration later by storing flat data as relational now. But all too often, LAMP was overkill. It was just how every website was made.

Are your data relational? No? Well, then you don't need a relational database.

Around the same time, many people were using Server Side Includes (SSI) to add common HTML content on-the-fly. This is handy, and it's actually a great solution for many situations. But when PHP 4 was released, all the cool kids wanted those .php extensions on their web addresses. Accordingly, many simple-minded web engineers used PHP 4 as an SSI engine. Again, maybe you just want to be ready for all those dynamic website features you have planned. But just as likely, you're really not using PHP.

Is your website dynamic? No? Well, then you don't need on-demand webpage generation.

These seem like really silly questions to consider. This is 2018, after all! Computation power for such use is incredibly cheap. But look around. Engineers are choosing to solve these simple problems in a simple way, regardless of all of the software and hardware available. Simple, elegant solutions still have a place in modern technology.

The Modern Blogger's Workflow

Look how pretty this is, after all:

$ vim 2018-05-03-static-webpage-generation.markdown
$ git add .
$ git commit -m 'new post'
$ git push
Counting objects: 4, done.  
Delta compression using up to 4 threads.  
Compressing objects: 100% (3/3), done.  
Writing objects: 100% (4/4), 397 bytes | 397.00 KiB/s, done.  
Total 4 (delta 2), reused 0 (delta 0)  
remote: Cloning into '/tmp/foreverlarz-com'...  
remote: done.  
remote: Configuration file: /tmp/foreverlarz-com/_config.yml  
remote:             Source: /tmp/foreverlarz-com  
remote:        Destination: /home/larz/www/foreverlarz-com/jekyll  
remote:  Incremental build: disabled. Enable with --incremental  
remote:       Generating...  
remote:                     done in 0.032 seconds.  
remote:  Auto-regeneration: disabled. Use --watch to enable.  
   4d78839..c8fa9b8  master -> master

And that's it. The blog post is live, version-controlled, and static. Jekyll is kinda cool.