Sunday, March 26, 2006

Blog Basics: Permalinks

I wrote some scripts to add permalinks, which a typical blog should have. I can understand why many people use dedicated blogging software, but I'm content to reinvent this wheel, as I'm comfortable with, and even enjoy, writing shell scripts. I also have more control this way.

I have one directory for every date I've posted. Inside there is one file per blog entry, containing an HTML snippet with the title in a h2 tag, and the date within a h3 tag. One script converts this to a page to be permalinked, while another pastes the entry into the main blog HTML files.

Inspired by the official Google blog, the permalink's filename is the title converted to lowercase with spaces converted to dashes, and all other characters removed.

I should eventually look into how the popular blogging software organizes things, but this scheme appears to work well.

No comments: