Gabe Rocks!

I don’t really want to ’let go’ of static sites because I think the benefits are too large to give up, at least as a single person. I love using static site generators. Being able to reuse code in an intelligent way is a huge win over doing all the css/html/js by hand. While it’s nice to be faster than a dynamically generated site, there are times where more data is needed. There are downsides too, such as not having dynamic server-side features. This generally means no comments, or visitor interaction of any kind.

Static+

Less than a CMS, more than a static site.

A reason a lot of “web 2.0” services got big, was that you could embed their fancier features into your hosted blogs. Within the context of self-hosted static sites, there are many reasons why you don’t necessarily just want to constantly embed various big-tech websites for relatively basic features.

One of my hugo sites pulls content from a public API to query information about legislation. Every time I regenerate the site it loads the latest information and inserts it in to the page. I thought this was pretty elegant, but it got me thinking. Is it worth using a database to store information to be used by a SSG?

The problem with wanting to take this step that unless your database is directly readable by your SSG/CMS and is ideally also quite intuitive to make changes to. This means that you’ll need at least a minimal set of API calls that move information in and out of the database and a server that runs them. Doesn’t this defeat the purpose of avoiding a CMS entirely?

Thinking out loud, I think there is a happy middle-ground where it doesn’t. If you’re simply doing it to replace simple widgets/functionality that is already quite at home on many static sites like search or comments I’d argue it’s a decent half-step. It definitely goes too far when you have to torture (or re-write) your SSG to support new features instead of just building your own custom CMS.

But How?

I’ve been fascinated by PocketBase which gives you all this (including static file support) out of the box. It seems to be a speedy drop-in tool for this kind of technique. It’s built on top of sqlite and provides authentication built-in as well. I only with it supported hardware-based authentication and then I would call it perfect. The more I think about how the web should be the less I believe that being able to reach millions of people should be the goal. Quality content isn’t always relevant to everyone at the same time, a better web should be a patient and discerning one in my opinion.


This is just an idea, if you have any thoughts feel free to reach out to me

Updates

Brandon has some interesting thoughts

But maybe we’re overthinking this! Why not simply use PHP in your theme files?


Reply to this post

Static Sites Static+ Webdev
Prev B @ Next