Home  |   Blog  |   Projects  |   Downloads/Media  |   About/Contact

How I Made my Blog

How I Made my Blog

If you are here, you are probably looking for guidance on how to make your own blog. I'm posting all of this information for free redistribution and copying, I really do not care if you copy my kind of crappy blog system.

The first thing you have to know is that this system requires a fair amount of maintenance on my (or if you use it, your) part. It also (as of now) is only designed for Linux/Unix systems -- it should work on Mac given that it is simply shell scripts.

I will include more documentation in the downloadable zip at the bottom of this page, but here's a basic overview: There are two main functions. One is a script that sets up the formatting for each post, each with some header information so it is standardized. It will ask you for author, title, date, etc. You are then free to modify the file it creates, and write your blog post. The other script is a sort of compiler. It runs through the directory of your posts (usually a "posts" directory in the same directory as the script) and compiles them all into one "blog-compiled.php" file. This is then included by the main blog page through a php include.

It has a lot of flaws, mostly in that if I ever want to change the header formatting I will have to write another script to fix all of my posts. Keeping everything standardized will hopefully make that not too much of a pain in the future though.

· · ·

I would be remiss if I didn't explain a little more in depth about how I landed on the way I currently manage my blog. I had a couple of requirements. For one, I knew I didn't want to deal with a huge ugly SQL database. I wanted everything to be stored in plain text, so it would be as transferrable and simple as possible. I also don't know SQL and don't really care to learn for this. Maybe some day. I also knew I wanted my posts to be permalinked somehow, as well as having each post contained within its own file.

The easy thing to do would have been to make one big file where I just constantly updated it with my most recent musings. The problem with that though is managing that file becomes quickly very difficult, so it made sense to separate out the files. I also considered making simply a list of links to posts -- simple, but as detailed more in my blog-philosophy page, I wanted the reader to have to scroll through all my posts.

Ultimately, these are the criteria I arrived at:

  1. Every blog post gets its own file in the /posts directory.
  2. There is an 'update' script that basically re compiles all posts in order of their post number (backwards of course)
  3. That file is a php file, lets call it "b-compiled.php"
  4. It gets included in blog.php, the main site of my blog that is now easily editable
  5. Each blog post is permalinked under posts/#####.php

I have formatted post numbers as 00001, 00002, 00003, etc. That gives me plenty of headroom. If I run out out of post numbers, I really need to get a life. Even at 10 posts a day it would take me 27 years to run out of posts.

I encourage you to also make a blog. Use your imagination, and make it from scratch! Or use wordpress, that is fair too, but there is something about making your own blogging system to exactly your liking that is very satisfying. You are welcome to use some or all of my system here in your own blogs. Also see this post on Drew DeVault's blog about why you should make a blog. He outlines some very compelling reasons -- most importantly, blogs are semi-permanent. None of this wishy-washy Instagram story crap where you only commit to a 24-hour cycle of posting. Write down your thoughts, damnit, and stand by them for a bit! While I have no monetary compensation to offer, if you create a blog, please send me an email and I will list it on my sidebar for all six of my readers.

· · ·

You can download the scripts and accompanying documentation here.