After quite some time ignoring my blog, I wanted to take a look at getting a slightly more modern theme. A quick look at the site found an official EOL notice for NanoBlogger. To replace NanoBlogger, I've chosen Blogofile which admittedly hasn't had any commits to its repo for about 2 years and could appear as dead as NanoBlogger. In addition to Blogofile, I've grabbed a basic blog template from Start Bootstrap to get something a bit cleaner than the basic Blogofile template.
Reasons for picking Blogofile
I'm a big fan of pre-generated websites letting static content be static rather than generated on the fly. Apart from the fact that it scales a whole lot better, it also avoids the usual security headaches that seem to follow things like Wordpress and friends. There's even an option to turn on comments without having anything dynamic on the site. It's written in Python which has been the language I've been playing with lately to add something beyond shell and Perl to my usual tool stack. There's a good varied template support giving me easy choices to write posts with a little more styling than just the plain html from NanoBlogger. The layout of the working directories is clean and simple and easily let me integrate old leftovers. Migration from NanoBlogger was pretty simple.
Installation and Migration notes
Installing Blogofile with pip doesn't quite work out of the box, but cloning the git repos and running python setup.py install did the trick. NanoBlogger keeps its post categories in two places - in cat__N_.db which contains the category name on the first line and in the master.db file which has an entry for each post with something like "2011-08-30T14_19_45.txt>6,8". That's the filename for the post and the N corresponding to the category files. In order to migrate, I manually changed the numbers in master.db to category names which didn't take long with a bit of vim. I also changed the > and the , into | for simplicity. Next I ran my conversion code (see below) as the simplest hack.
with open("master.db", "r") as master: for line in master: ent=line.split('|') file=ent.pop(0) with open(file, "r") as infile, open(file+".html", "w") as outfile: outfile.write("---\n") outfile.writelines("categories: " + ", ".join(ent)) body=False for inline in infile: if body==True: if not inline.startswith('END-----'): outfile.write(inline) elif inline.startswith("BODY:"): outfile.write("---\n") body=True else: head=inline.split(': ') if head in ['AUTHOR', 'DATE', 'TITLE']: outfile.write(head.lower() + ": " + head)
Pretty simple stuff putting in the YAML headers, the new categories and lowercasing the remaining headers that are reused. Once it gets to the body it just copies line by line. The only problems that ran into was titles with : and # in them, which was easy to fix by hand.
Changing the templates only took a little bit more time than it should have because the last time I cared about writing HTML, CSS had only just been invented.
I've got a bit more tweaking to my site to get done, making it less ugly and to add some of my pictures. There's also a couple of blog posts about OpenData half written in my mind, which should appear as time permits. After that, your guess is as good as mine. Maybe some of what currently goes out on Twitter will end up here along with some of the pictures that go on Flickr.
February 23, 2010 at 10:10 | categories: soulfood
July 05, 2009 at 13:18 | categories: soulfood
I've got a very nice choice of parks near to home to choose from when the
weather is good.
View nearby parks and gardens in a larger map
A hidden gem nearby. It didn't look like much when I went by during winter, but now it is an explosion of color with a great variety of flowers. Below are a few images shot yesterday on a rather windy day. More on flickr....
The largest park in the area that can get rather crowded on Sunny days. Home
to a large population of herons and ducks.
Also contains my favorite spot for relaxing in the city (see below>. More on flickr....
Kongelige Haveselskabs have
Right next to Frederiksberg Have is Kongelige Haveselskabs have with a good selection of plants. Morn on flickr....
The zoo. I for access all days so that I can walk through the zoo when I'm nearby. More on flickr...
A small rose garden across the street from Frederiksberg Have. More on flickr...
June 28, 2009 at 21:40 | categories: soulfood
Last week I took 4 days off from work and headed to Legoland with part of my family. Come to
think of it, that's the longest time I've been away since my vacation last
january - with the Busy
times lately, it was long overdue. Going without email and net access is
quite enjoyable (except for the hassle of sorting through an overflooding
mailbox when you get back).
We stayed at Lalandia which is right next to Legoland and the airport. It's brand new and everything was really nicely done - we rented a really nice house with room for 8 people and it fit 6 people quite comfortably.
And don't forget to bring one or more kids to enjoy the experience!
I don't know when or where my next vacation will be, but I know it's not going to be many months from now and I'm already looking for somewhere that'd let me relax and perhaps shoot one or two pictures along the way.
Next Page »
- Andrew Godwin - What can programmers learn from pilots
- New blog software and layout
- Today I made it into Flickrs TwitterTuesday
- bread meatloaf recipe
- Osso buco
- XKCD gets close to the truth
- Open Source Days 2010
- Autumn has arrived
- Recipes - Sottofiletto di Manzo al Pepe Verde and Pere al Vino Rosso
- Nearby parks