I'm not entirely sure why I decided to design the site from scratch rather than using TypePad, WordPress, or Moveable Type. I suppose that in the end it's because my vision for the site included not only a weblog, but also a database of external links and a number of other features. Plus, given that one of the primary purposes of this site is to market myself as a web developer, the fact that I created the whole thing in Notepad is something I can put on my resume.
Actually, while I used to use plain vanilla notepad, I've become fond of notepad++, which is basically notepad with syntax highlighting for a number of programming languages plus multi-document tabbed navigation. It highlights my PHP, CSS, and HTML quite nicely.
So what have I included in WebFu that I left out when coding my blog at GregHowley.com? Let's see...
AddHandler-based directory structure
I don't yet know much about Apache, but I learned a neat trick whereby you can create an extension-less file and use Apache's ForceType directive to force it to be handled as a PHP file. Why? the end result is friendlier URLs. Once I've told Apache that an extensionless file named articles is PHP, I can enter articles/fred/bob/joe/stewie and the articles PHP file still runs just fine. That means that I can parse the URL from within the PHP file and use the later subdirectories to locate the appropriate entry in a database. So instead of having an article located at webfu.greghowley.com/articles.php?article=xhtml_in_a_nutshell&page=2, I can pull up that same file at http://webfu.greghowley.com/articles/xhtml_in_a_nutshell/2. Much prettier URL. And more search-engine friendly too.
Dynamic categories
In my first blog, I set up a fixed number of categories as a enum field in the mySQL database. In the database for my articles on WebFu, I created a text field named category. When I want to list categories, I just select distinct on that category field. And in my admin interface, I choose from the existant categories rather than extering from scratch each time to avoid typo-related category splits.
Summaries
The layout of my blog at greghowley.com shows the entire text of the most recent ten posts. I wasn't sure how much I liked that format, so in this one, I display the four most recent posts and show only summaries. These brief summaries are also useful if I later decide to implement trackback, with which I've had some problems in the past.
Blog entries can be filed under multiple categories
While I used a simple text category for my articles here, I set up three separate tables for categorizing my blog posts. A table for the blog posts, a list of categories, and a table linking them. This way, by making multiple entries on the link table, I can associate a post with as many categories as I like.
CSS-only layout switching
While on my blog at GregHowley.com I do have different layouts, they are actually separate PHP files, each with different markup. Here, I just apply different stylesheets to the same markup. As of this writing, I've only got the one style, plus an option to display the content with no stylesheet, but I'll create more in time.
Text-size switching
I still have a lot of tweaking to do with the text-size switcher - the alternate sizes don't make me happy as-is. But they work.
I'll probably make many more changes to this site over the coming weeks, but I'm glad to have it online at last.