I have had this unexplainable sense of impending doom over the past week or so. It always gets disproven, I know these thoughts are usually pretty silly, and I've experienced enough emotional upset in my life to learn to ignore it pretty well. Still, vividly imagining my getting terminated at work or spending this morning pondering how all my backups would be completely fucked in the case of a house fire, of course. (Tossing out all my working creative methods to try and make it easier on myself in the future has had the exact opposite effect in the short term, also.) I swear I've been having much weirder dreams than usual lately, but damn if I can remember them now.
So while I ease those thoughts by working a little harder on the clock and looking into a BackBlaze subscription, let's dust the journal off with some Web talk like I do best.
I intended to have hifi finished by the end of last month, but aside from my lack of desire to work on it, I have hit a certain road block in site structuring that requires some planning and PHP. Keeping three sites in sync is not easy, doubly so for sections with a ton of static pages, like my Guitar Hero modding tutorials or my stories. Each version across nofi/lofi/hifi has roughly the same page content, but differences in markup and image handling that make them kinda completely nightmarish. nofi uses no CSS at all; lofi uses no HTML5, and thus much fewer semantic elements. hifi alone uses <figure>
and <figcaption>
for styling images and their associated captions. All three use similarly-named images in different file formats.
The worst part? Each page, multiply it by three. If I have 19 tutorials on my site, I'm actually maintaining 57 pages on the backend. This is not realistic on myself.
My stories present an extra challenge, page length. My old stories on mari_v2 were short enough that they could go on a single HTML page each, but if I ever write anything longer (which is a definite possibility in the future), page weight and ease of reading become a concern. I'm catering to Windows 95 computers with 64MB of RAM running Netscape 3.0 alongside your phone or gaming desktop. With one longer story, I can easily make that machine eat shit, or split up to make it happy, annoy people on modern machines who want an uninterrupted reading experience. Or, perhaps, people do want things split into smaller chunks! Does that mean they'll be forced into using nofi with none of the creature comforts of lofi and hifi having actual layouts and page widths and shit?
Here's my proposal. I'm writing this for my own use as much as your enjoyment--explaining the solution is the first step towards implementing it. (I get none of this is particularly fancy and I'm potentially overexplaining things, but I'm also writing for friends and people who don't work with databases. Not everyone can be as smart as you, Greg.)
I've already been making good use of PHP and MySQL stuff for my album reviews, and I think they're the answer here as well. If you don't know, a SQL database isn't just potentially one chunk of data. They can have any number of database tables in them. Databases contain tables, tables contain rows, rows contain as many individual cells as needed, and all of these are easily identifiable and are a really excellent way for organizing big slabs of data.
The plan is to have a database where each "bundle" of reading material, whether that be a tutorial section, a story, or a collection of stories, is its own table, and each row is an individual (HTML) page and associated metadata, like page descriptions or if each row belongs to a larger chapter. I can then use PHP to get rows and tables on demand and manipulate and format them as desired, using find and replace to save me having to maintain each version of each page separately, or joining rows together to have a story on one, unbroken page.
Obviously, for larger stories, the appeal is obvious. I write the markup once, and PHP can, all on command, return the whole story on a single page or return the nofi version with CSS classes for character dialogue color coding replaced with <font>
tag soup all without me needing to do anything. PHP offers some really nice find and replace functionality, like accepting arrays for both the find and replace in an operation. I just have a list of what to replace with what for each site version, and it brings it to your browser without me touching anything.
For smaller collections of stories, each row can be its own stort. With what I've currently been writing with Pennyverse, that can be a prose snippet, a chatlog, a typed up fake news article, or frankly any way you can tell a story in a chunk of markup, like individual pictures for a comic. Point being, all of these tiny stories are nicely organized together, but can be returned separately. Tutorials work the same way: all tutorials are collected in one place, and I only have to write them once and do the find and replace for each mari.somnol version.
As a nice bonus, .htaccess trickery lets me do this completely invisibly in the background by rewriting the actual, messy links to the PHP script that does all the heavy lifting with HTTP GET variables and the like into nice, clean, static-looking URLs. Something like stories.php?story=kevin-and-theo&page=2
becomes stories/pennyverse/kevin-and-theo/2/
and back as well. .htaccess silently redirects a request for the latter to the former, the script looks up the correct row in the correct table, returns the text, formats the page, and delivers it to you at the latter URL without you ever seeing the redirects. Pretty neat, huh?
I'm going to soft launch hifi without any of this having been done hopefully within the next week. I can't do any database work on my home server copy because DreamHost obviously doesn't accept offsite database requests. I'm sure WampServer packs some kinda MySQL solution into it that I can use (hence the M in "Wamp"), but I never set anything like that up and frankly, I'm okay with just deferring it. It's better to have it online over perfect, and it's better to let people enjoy what I've done so far than make them wait even another week for me to implement another feature, even if it is a very cool one. I really have to start downsizing and chunking my projects more, so I think a soft and incomplete launch is just what the doctor ordered.
That, and a full Somnol Discord server backup just in case something happens. Did I mention I've got a weird sense of dread lately?