Redesign Part 2
My website has a fairly decent design, but it is not without its flaws. I’ve been working over the past week to correct some of those and add new features that are expected on a serious website.
Social bookmarks
The way to promote websites these days tends to be through social networking; typically, sites like del.icio.us, digg, reddit, etc. If a user enjoys what you write, it’s gotten incredibly easy for them to “spread the word.” Thus, I wrote a bit of php that takes the article name and generates handy bookmarks like you see on so many blogs today. I use my del.icio.us account pretty extensively, and if you haven’t tried it, you should. Nothing will replace having a good bookmarks toolbar, but for all of those “interesting” sites you don’t visit every day, del.icio.us is invaluable.
Search and Navigation
As per my original goal, I wrote a search box that will search my blog using the google engine, and has an option to search the web instead. Unfortunately, squashing a css bug in the nav/search bar made the (previously working) search box not show for IE users until I came back to the problem a week later. The top bar would slide past the rest of the content when the screen size was narrower than the columns (about 870 pixels). One thing I learned is that putting <div> inside of a <p>
element breaks xhtml compliance. Go figure.
CSS Debugging
As a corollary to “Search and Navigation,” one of the most egregious problems I’ve had to deal with is buggy CSS; you change one thing, you break another. The afformentioned search bar bug was the most recent example. That took gutting the css for that section, and rebuilding it. The only problem? The search bar didn’t show up in IE. I called it a night, came back a couple days later, and knocked the problem out. Lesson learned: when you try and fail, take a break from the problem. It also taught me that I don’t know CSS as well as I thought I did. The code isn’t perfect, but it does what I want it to now.
RSS
Learning how to create a proper RSS feed has been interesting. Of great use was the Feed Validator. I started out with the basic definition; a channel, an item, a link, and a description. Then the validator said I needed to fix a few things:
- Add the string “
AddType application/rss+xml .rss
” (sans quotes) to my httpd.conf - Add the
<guid>
element to make sure rss readers didn’t misread entries. I wish ThinkGeek would learn about that one, because I’d get what felt like three duplicate items from their feed every day. - Add the
<pubDate>
tag; without this, a newsreader identifies the feed item as dated whenever it was downloaded. It’s not required for valid rss, but it’s nice to have. - Add the
<ttl>
tag; it specifies how often a newsreader should check a feed. As I don’t update that often, it’s unnessasary for a newsreader to check every four seconds.
To see all of these improvements in action, take a look at the source of my rss feed.
What’s next?
I’ve definitely been saving the harder things for last:
- SQL back-end. I know that the more interesting modern websites are front-ends to databases, but I don’t really know where to begin on this one. I know it will involve creating a database and placing my articles in it, and then using PHP to load the articles from the database upon request.
- Comments. Comments are sort of a collary of the SQL problem. Once you’ve got a database of articles, each article can have its own database of comments.
- Flash. I’d like to find something that looks as nice as the static flash text, but doesn’t require a plugin. Images will probably work, but that will take time to do. Also, I’m not keen on generating an image for every article that I write.
- CSS Cleanup. I’m not using all of that crap, so it’d probably be a good idea to clean up and comment the code wherever possible.
Leave a Reply