RT Cunningham


My Custom CMS Could Be Interesting to at Least a Few Web Developers

custom CMSI designed my custom CMS to use as few resources as possible on a $5.00 droplet at DigitalOcean (yes, that’s a referral link) and I shared the code for it for some time, along with the code for a WordPress static site generator. I stopped sharing any of it, along with updates, when I realized it wasn’t worth my time.

You see, far more people care about website content than what creates it and that applies to both content creators and website visitors. Less than two visits to some specific URLs over the course of months showed me a complete lack of interest in the technical side of the story. I would have had to be a dedicated developer for an established CMS to get any real traction with them.

A Two Part Custom CMS

The custom CMS runs on my laptop computer. Only the results end up on the web server. My laptop computer operating system is Linux Mint, a Debian and Ubuntu derivative. The server operating system is Ubuntu, a Debian derivative only. Both machines use compatible code since I’m using Nginx and PHP on both of them.

This is the software I use for the laptop computer side of things:

I recently removed Syncthing from the equation, streamlining my workflow somewhat.

My Workflow

When I draft a new article, the first thing I do is create the title with the appropriate keywords. Then I hunt down a suitable image. The first place I look is Pixabay, but there are other places I check when I have difficulty finding what I want. Wikimedia Commons is one and Stock Snap is another.

I save the image to my pictures directory and edit it with XnView MP. For me, it works as well as Irfanview on Windows. I then save two images to the CMS images directory, one at 150 pixels wide and the other at 1000 pixels wide (unless the original image is 1024 pixels wide or less). Using the Responsive FileManager plugin with TinyMCE, I link the smaller image to the larger image (when I use a larger image).

The form I use for creating and editing posts contains the post title, a schema block for the post image (whichever I select if there’s more than one), the content area, the meta description, a list of categories to choose from, the date and the time. The form for the static pages doesn’t have categories.

When I save a post, it’s saved to the same directory locally as it ends up in at the web server. I can edit the post at will until I’m ready to publish it. Publishing it means it gets loaded, local URL references get changed to the web server URLs and the post is saved to the appropriate directory on the web server. My article about my WebDAV setup explains some of the details.

Except for rare circumstances, I share my posts on Facebook and Twitter. I credit image authors as often as I can and I sometimes publish my links at their sources.

File Formats

There are two directories concerned with posts at the web server. One is the posts directory and the other is the cache directory. Each post is an ini (“.ini”) file that’s read by the PHP parse_ini_file function. The PHP routines at the web server cause each post to be displayed as web pages while caching them (if the previously cached pages haven’t expired) exactly as they displayed.

I prefer JPG and PNG files for images. I never use PNG files for the larger images because JPG files tend to be smaller than PNG files. The visual differences aren’t noticeable by most human beings.

Alternatives to a Custom CMS

The heavy lifter, the one size fits all software is WordPress. You can choose to host your website at their commercial service or you can host their software on your own web server. I self-hosted WordPress for many years.

I like BatFlat because it’s a lightweight CMS that uses SQLite instead of MySQL as it’s database component. That means it uses a lot less memory to do most of the things I would need it to do. If I didn’t create my custom CMS, I probably would have switched to BatFlat.

There are hundreds of CMS platforms available. There isn’t any way I could possibly go over all of them. You can find a list of content management systems at Wikipedia and even that’s incomplete.

Image attribution: The original Nginx logo is in the public domain. The original PHP logo is by Colin Viebrock (Download Logos and Icons) [CC BY-SA 4.0], via Wikimedia Commons. The combined image is by RT Cunningham, with the same Creative Commons license.
Edited and updated. Originally published in January 2020.

Share: Facebook | Twitter

By RT Cunningham
May 9, 2020
Web Development

My New Site:

Gray Matter