compiledtext.com

Home  Archive  <<  0 >>

How I created this site

2022-06-25

The viewer of this website in 2022 may wonder whether they've stumbled onto a plain relic from decades past, or the "Hello World!" of a never-to-be web developer. This is not a pretty site. No frameworks were used to create this site. This is not only because I don't know any frameworks, but also because no framework is needed to create something as simple as this. It's basic stuff and it can be fun to work from scratch. This is a place for words, links, and other Web1.0-era hardware, and you're not going to find Web2.0, 3.0 (this is really pushing it), or beyond here. At the time of writing, this website is a few kilobytes in size, meaning that you could fit a couple hundred copies of it onto a standard 3.5 inch, 1.44 megabyte capacity floppy disk without compressing it. Each keypress adds at least another byte, a fact which I feel bad about. Not that bad, though, since internet connections are fast these days and it's nothing compared to all the other stuff you download when you visit any other website, whether you want to or not.

This website is generated by a small program, a few hundred lines of C code that I wrote over a long, hot holiday weekend. At least 90 degrees out. You might call this program a static site generator if you wanted to make it sound modern and legitimate in the way of the W2.0/W3.0+, rather than like some kind of crude hack or duct tape-job. To create a new post here, I create a text file which has three things: the title of the post, the publication date, and the corpus. This text file gets saved in a folder I've dubbed the "raw" folder, since it contains the raw .txt files which are converted to pages of this website. The title is extracted and put into a large heading, and the date into a slightly smaller one. Converting the body of each post from text format to HTML is almost a no-op. Line breaks get turned into <br> elements (the equivalent of a line break in HTML), and otherwise, the prose is simply copied from the text file to the HTML file. If I want to put a link or some other HTML element into the post, I just write the corresponding HTML into the body. I'll spare you the details of the particular naming convention and file format which must be obeyed in order for this to work; partially because it's boring, partially because it's liable to change, and partially because it's embarassingly crude.

Once the raw folder is loaded up with the posts for the site, I run my program and it spits out the files that make up the website. This is a lonely few files for now since this is the only post. One file for the home page, one file for the archive page, and one for this post. There are also a couple of CSS files, which are the real workhorse of this site. I initially considered whether CSS was really all that necessary in the first place. I quickly decided that that a few more dozenbytes worth of CSS would sweeten the deal for anyone who happened to land here. It was downright unpleasant to look at the Lorem ipsum on the test page before dropping in the handy few lines of CSS shamelessly cribbed from Jackson's This is a web page. And it's still not pretty, but it's better than reading a raw text file in a browser. It's good enough for now. I've never been that big on JavaScript, but at some point it seems likely that some will be needed. I've escaped it for the time being.

After the program spits out the files that make up the site, I copy the files to my server so that they appear when you hit this address. "My" server is a rented VPS from DigitalOcean. It has a single-core processor, 1 gigabyte of memory and it's running Apache. I expect that the specs of the server far exceed what will ever be necessary to host the site.