Googling From Blosxom

I’ve made a few changes to my copy of Blosxom to add the little “Google” link you see at the end of this entry. I’ve seen this on other blogs here and there so I decided to add it to mine. It consists of a subroutine called buildGoogle that takes the second line of each story file and builds the Google URL with the query string built from your keywords. The second line of the file will only be used as keywords if the line starts with KW:. If it starts with anything other than that, it will be included as part of the body. For example, a file with this

KW: blosxom perl blog

as its second line will produce this

 | Google

To include the link itself in your stories, edit your story.html and add $google wherever you want the link to show up. If the link was not built because you didn’t have a KW: line, then nothing will show up. This is from my story.html. Notice it comes right after code creating the perma-link.


Here is the patch if you would like to use it.