site posts

Project: Website theme switcher

I finally made a theme switcher for my website. Ever since I saw the CSS Zen Garden, I loved the idea of using the same markup with completely different appearances. This led to a desire to have multiple themes and an ability to switch them on my own site. Early on I didn’t have the ability, and later I didn’t, have the energy or time, or decide on the way I wanted to do it. There are performance and complexity considerations, as well as needing to make decent themes other than the default one. My eventual desire to have a static-friendly site complicated the performance aspect as well.

Some browsers have a built in way to change to alternate stylesheets, but they stupidly download all of them even when they’re not being used. I’m not doing that. So JS or a server-side cookie solution are needed, and the latter won’t work for static sites. I try to minimize the JS on my site and didn’t want something heavy or complex, especially if it were loading before page render.

Recently, I had the energy and decided on a simple, lightweight JS way to do it. I decided to start it even without real alternative themes.

Continue reading post "Project: Website theme switcher"

Server upgraded from Ubuntu 20.04 to 22.04

My server was on Ubuntu 20.04, but due to the end-of-life of that LTS version next month, I have upgraded to 22.04. My server is managed with Vagrant / Ansible. My plan had been to do a new local VM on the newer version, get it working properly with Ansible, then set up a new server with it and migrate over. However, since Ubuntu isn’t releasing an official Vagrant box for 24.04 and beyond, I don’t think it makes sense to take that path. I may move over to Debian or look into Vagrant alternatives, but to get this done before EOL, I decided to just try a do-release-upgrade to upgrade the existing server in place.

Continue reading post "Server upgraded from Ubuntu 20.04 to 22.04"

Site partially static

I am pleased to say that most of the non-blog parts of my site are now served from static files. I have been working toward making a static version of my site for a while. I have created a PHP static web task that can crawl a site and turn the responses into an Apache friendly directory structure. Those pages now can be served extra fast, without going through PHP, and could be served on a free static host if I wanted. To go static, I not only had to write the code to build the static files, but also had to modify my site code to have the desired output when called from that context and modify my Apache configuration to respond correctly and add some headers that were being added by PHP before.

Continue reading post "Site partially static"

Playing with GitHub Pages

This past weekend, I started playing with GitHub Pages for the first time. It took a while to figure out, but was somewhat fun. I’ve been interested in it for a while, but was unsure of how to do what I wanted, such as building with PHP, Sass, and Rollup. Turns out it was fairly easy with GitHub Actions to do most any sort of build steps I want. It is very interesting for free static site web-hosting.

Continue reading post "Playing with GitHub Pages"

April Fools

I have made my first (I believe) April fools feature for my website. On April 1st, the page will spin around 360° on load and every time the user clicks. It’s a quick script I threw together this evening after deciding I wanted to finally do something for the day, as a number of websites do such things. It didn’t come together as smoothly as I hoped, which made me all the more determined to get something in place before the end of the day.

Continue reading post "April Fools"

</toby>