After a decade or so with a website that was just a single paragraph containing
it was time to actually do something with the site. I’ve tried before, but each
time I ended up writing blogging software instead of contents. I really enjoyed
writing that software, but it didn’t result in a website.
This time I decided to go with Pelican, a static site generator. I’ve found
that I’ve enjoyed using a static site generator, and there are many ways it
does things that I’ve preferred to something like Wordpress.
Simplicity was important to me, and a static site generator is just a
collection of text files - one for each blog entry, and one for each page on
the site. Everything else is generated automatically, even the looks, RSS feeds
and site navigation. The files I write only contain the contents of the blog
entries, I don’t have to supply anything else. This reduces overhead and
complexity for myself.
I’m able to write the pages and blog entries on my own machine, even when it’s
disconnected from the network, and I can use any tools I want. I don’t need a
browser - I just need a text editor, and I can pick the one I prefer (Vim of course).
process is very robust, simple and fast. I don’t have to worry about servers
going down, software updates or security issues — there can’t be any. Pelican
has a nice little tool to help you get started and makes it easy to work its
features. It’s also really speedy - it takes less than a second to regenerate
I store the source to the blog in Mercurial (a distributed version control
system, like Git), and I have a post-commit hook on my server which builds the
site when I perform an hg push. That is - all I have to do to publish a new
article, or version of the site is to type hg push on my local machine, and
the final result is uploaded to my server. The post commit hook just runs make
html and places everything in a directory for Nginx to serve up. I was
inspired to set that up by Sam, who linked to a description of how his blog
used it in a G+ update. It feels trivially easy to produce an update.
The blog entries themselves are written in ReStructuredText, which is a very
simple markup language. It’s almost purely plain text, much simpler than most
wiki markup. It’s similar to Markdown. I picked ReStructuredText over Markdown
because I wanted to become more comfortable around RST.
Pelican also supports plain HTML, and it works remarkably well. If you already
have some pages written in HTML, they can just be copied right in. The theming
is so simple, even someone like myself can manage it. There are also a lot
already created, including ones that build on Twitter Bootstrap.
There are a lot of alternatives to Pelican, such as Octopress, Nikola, Jekyll,
Hyde, etc. I picked Pelican because it was the first hit on Google; that is as
complicated as my decision got. With contents written in RST, moving to another
static site generator would be trivial, so I wasn’t too worried about my
choice. I’ve been really happy with Pelican, and I will happily recommend it to
anyone who feels comfortable with running their own web server.
What does it look like?
Now we are being herded into the nineties
:date: 2013-07-03 10:20
:tags: pelican, python, web
:author: Rikard Anglerud
:summary: Rawmeat.org rebuilt using the Pelican static site generator.
After close to a decade with a website that was just a single paragraph
containing the following:
That is this top of the file that defines this blog entry, and it really is
that easy. Nothing to it!
Over and out, darkness is falling.