static site generator

posted: Fri, Jun 2, 2023 | tagged: | | dev | web
return to blog home |

static electricity, err web content

eleventy static site generator

I've recently decided to transition my website from hand coded HTML with dynamic server-side encoding (such as PHP, Python or some other interpreted language), I've decided to migrate the manner in which this site is constructed over to a Static Site Generator (SSG).

And in particular, I'm using 11ty.

Before you say it, yes 11ty uses JavaScript. But only for the generation of the site and for configuration and extensibility purposes. Take a look at the 11ty site for more information before you start the lynching.

so why 11ty?

I've wanted to setup a blog and and a repository for hosting wiki pages for quite a while. But I frankly don't want to deal with the security implications of using a dynamic language, server theat landscapes or a database. By using a static site generator in a jamstack architecture, I essentially remove the vast majority of the threat from hosting infrastructure on the web.

This also gives me a legitimate excuse to finally give in and learn JavaScript (insert obligatory grumblings here), which I've been avoiding for quite some time. Also 11ty felt familiar to me because of my work with Python, the Python web framework Flask and the templating engine Jinja.

For those looking to get started with a SSG, I'd point folks over to 11ty and this video by Stephanie Eckles (@5T3PH | 11ty Rocks!) on YouTube: Eleventy: Key Features and Getting Started.

what is Jamstack?

A good question. It is an architectural approach for building websites in a decoupled manner to improve security, flexibility and performance, amongst other elements. The JAM in jamstack stands for JavaScript (front-end frameworks), APIs (RESTful APIs) and Markup (HTML, Markdown, etc). Read more about it here: Jamstack - while I learn more about JavaScript on my end.

One of the elegant differences of a jamstack architected site is that you can essentially eliminate the need for a web server. You can deploy your entire site to a S3 bucket with static site hosting eliminating the need for administering infrastructure nearly entirely. As of the time of this posting, this site is still traditionally hosted via a typical web server / web host architecture.

That may change in time, or even short order.

why not a Python SSG?

Well, it is time that I actually broke down and learned JS. I've put it off for long enough, and it is just time. So here I go.

a serious plus for statically generated sites

added on June 15, 2023

The load times scream. I used to have my site fully coded in PHP. Now that I have stripped the site down to just HTML, CSS and a dash of Javascript here and there, the pages load incredibly fast. Also there is nothing to compromise. All of the content is just markup language that I write in Markdown within VS Code within my 11ty project structure. I push a few commands to update my git repos and to compile the site, then upload the changes.

In time I may look to move to a S3 bucket with static web hosting or to Netlify for hosting, but I'm very satisfied with the results thus far.

related posts

return to blog home