Embracing the static
A harebrained scheme finally nears the finish line as I drop WordPress, MySQL & PHP
I have been watching the swell of the indie web for a while and really wanted to dive into it myself. However, since the pandemic and the arrival of Tiny Troll in 2021, my time for personal projects (which includes blogging) has been extremely limited. To be frank, most times I just wanted to finish my ESO dailies and crash out.
I have been massively inspired by Aywren's adventures with building a static website and the long-term project of migrating their historical posts to the site. These progress updates helped to kick-start my own journey to build something that wasn't dependent on lots of third party elements, software or libraries.
Personalising the internet again
We continue to enjoy the day-to-day benefits that Web 2.0 gave us:
- Dynamic interactive sites,
- Content streaming,
- Real-time engagement,
- Instant gratification etc
It is easy to forget all the things that we lost in exchange for that newer, shinier internet experience.
Websites used to be expressive, everyone owned and controlled a piece of something that was theirs for sculpting. There was a great community spirit, sharing of ideas and collaboration. This same energy shines through very brightly during the Blaugust event and is one of the reasons I adore it so much.
The indie web has not only seen those that remember the good old days embracing the things that mattered the most in Web 1.0 but a new wave of internet users that want to experience the freedom to express themselves without the confines of a corporation-dictated status post or judging everything based on how to feed it into the algorithm. Very Refreshing.
Humble origins
In March of this year, I started looking at an idea that I had to use XML data to manage the blog posts data. I use XML in my job quite a bit so it was a simple avenue for me to explore without too much effort. My idea was to use a XSLT file (a stylesheet for your XML Data) since all the modern browsers are able to transform XML using a XSLT file, I wanted to see how fair I could run with that idea.
If you are interested, you can see a demo of this work here https://plus.welshtroll.co.uk/
Warning it's filled with different Lipsum text examples.
Unlike this current version of my site the links for Tags and Topic all work.
I loved this idea as all the content is generated on the fly in the visitors browser and not hardcoded. It was faster than I expected even on slower connections which was a concern I had during development.
However, a number of problems revealed themselves, most once I'd completed the bulk of the work.
- Firstly the demo solution uses JavaScript to trigger the transformation of data into HTML page content, I wanted to avoid JavaScript if possible.
- The posts weren't cached so would generate more calls on the server, each page would see 2 additional calls as it has to load in the XML and XSLT files to process them.
- RSS generation was fine, however RSS readers would not wait for the page load to complete before consuming it, so it would end up marking it as bad or they didn't process the XSLT/Javascript as they aren't really "browsing" the RSS feed. I had to use PHP to fix this, which was less than ideal.
Version 2
So the version of the site you see before you didn't abandon all the learnings from that initial version, infact almost all of the XSLT files are still used.
Rather than generating the data in the browser using the files, those files are generating the static pages using the same data source.
I still have a to-do list of items that need addressing, plus I want to import all of my older posts once more, maybe once Blaugust is over as the job will need some additional focus to get completed.
Yes I build a static site generator. But Troll you could have used X, Y or Z instead.
Interestingly, I did try out a few different static site generators as part of this endeavour, and while they all had great things going for them, one of the primary considerations was ease of setup/use. Building 1000 pages in 3.6 seconds is truly remarkable, but having to build a whole development environment for it to run in when I just want to change and rebuild one single page wasn't my cup of tea.