Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Fri, 21 Dec 2012

Nikola, a static site/blog generator written in Python

A peek at the Planet Python blog aggregator (I'm a big Planet blog fan, in case you didn't know) clued me in to a project I'd never heard of before: Nikola, a static website/blog generator.

The project site looks pretty good, and there's a nice "handbook" with information on how to install, configure and use Nikola to create static websites with its Python backend. New releases are announced in a blog built with Nikola.

A list of sites built with Nikola provides a few examples of the system's stock theme.

Features in Nikola include tagging for entries, archiving, Disqus comments and easy-to-use image galleries.

Part of what made me notice Nikola is its use of Python. I find that the best way to get to know a programming language is to use applications made with it.

Right now, I'm pretty much at the end of my look at Nikola. My system is running Debian Wheezy -- the soon-to-be-stable GNU/Linux release that I use for just about everything. Nikola isn't in Wheezy, Debian's current Testing distribution (slated to go stable sometime next year).

Right now Nikola is in the Debian Sid (aka Unstable) repository. So are many of its dependencies. I tried to install it on my Wheezy system using .deb files and the gDebi package management tool, but it's not happening.

I also tried the Nikola Handbook's preferred method of installation using Python's pip utility. (I got pip in Debian Wheezy package python-pip.)

Both installation attempts (.deb packages from Sid and pip) failed. With pip I was able to get Nikola installed, and I created a test site, but it wouldn't build. I got the following output in the terminal:

$ nikola build
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/doit/doit_cmd.py", line 97, in run
    return self.sub_cmds[command].parse_execute(args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 56, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 209, in execute
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 171, in load_tasks
  File "/usr/local/lib/python2.7/dist-packages/doit/loader.py", line 86, in get_module
    return __import__(os.path.splitext(file_name)[0])
  File "/tmp/tmpc7zWs8.py", line 8, in 
    import conf
ImportError: No module named conf

Not knowing Nikola or Python very well but looking at similar error output from other programs (thanks, Google), I'm suspecting that the conf.py file isn't being picked up by Nikola, even though it's where it is supposed to be. I could (and probably am) totally wrong.

I posted my error output to the Nikola forum on Google Groups. Maybe somebody will have a fix.

Other static-site generators written in Python: