Ramblings of General Geekery

Piecrust Drives A Truck

PieCrust 2.0 beta 5 is now live on PyPi, so you can go ahead and pip install --pre piecrust -U to get it.

The 2 big new features in that release are the last reasons I switched to Python for PieCrust 2 after packaging and multi-core support: better ways to launch and manage sub-processes. This lets me do:

  • Publishing support, because baking your site is only the beginning, and you actually need to upload that stuff somewhere.
  • FoodTruck”, an optional administration panel to work on your site(s) the same way you would with a traditional system like WordPress.

More after the break.

Publishing

A lot of static website generators out there already have this concept of “publishing” your website, i.e. not only bake it, but also upload it to some FTP server, rsync it, push it to GitHub pages or an S3 bucket or whatever. Support varies from system to system.

Well now PieCrust at least has the basic infrastructure to support the same kind of feature – something I have been delaying for too long! There’s only support for arbitrary shell commands and rsync, but I’m hoping more publish targets will come soon.

For more information, see the documentation on publishing your website.

FoodTruck

I’ve wanted to do this for a while now, but had to figure out the right way to do it, which is to provide a web administration dashboard that you can use to work on your website.

Now I know what you’re thinking. Isn’t the whole point of static website generators that you keep everything simple as text files, and you use your favorite (and most productive) text editor? Well, of course!

But the reality is that you need an optional adminstration panel for 2 reasons:

  • First, you want to attract newbies and non-technical people to the dark side of flat-file CMSes. Making it attractive and usable to them will hopefully be one of the gateways for them to become more technical, and in turn maybe participate in this wonderful melting pot that is the open-source
    web.
  • Second, have you seen the average blogging frequency of a static website user? Have you seen mine1? I believe that it’s a consequence of the price we pay in terms of practicality: to post something new, we have to get to a computer that has our site repo, and some way to bake and upload that to our web server. But it doesn’t have to be that way. You could also have an administration panel running on your server, so that you can also quickly post on the move, from your phone, and it would take care of baking and publishing for you in the background.

As I was writing FoodTruck, a couple static website generators appeared with an administration panel – most famously Lektor, by Python superstar “mitsuhiko”2. As far as I can tell, these are mostly geared towards the first reason, i.e. provide a nicer, user-friendly way to edit your website.

Hopefully, they start moving towards the second reason too. That second reason is actually the heart of FoodTruck, although there’s still a lot of work to get there. Consider:

  • The administration panel needs to run some heavy process (baking and publishing) from a web page.
  • The administration panel needs to be able to submit to your Git/Hg/etc. repository so you can then pull the edits you made on the go once you get back home.
  • The administration panel needs to be secure, obviously. And I don’t know shit about web security.

It can do most of that already, but not well enough yet for me to be comfortable with letting you all run this code on a public web server… so stay tuned for the next few releases, and check out the documentation on the administration panel for more info.


  1. Ironically enough, my blogging frequency went down around the time I started writing my own blog system… although that’s slightly misleading, because that’s also around the time I started having kids, and coincidentally figured I should focus more on fewer home projects in order to actually ship them, instead of always leaving them in a half-finished state. ↩︎

  2. There go my chances of having the most popular Python static website generator! ↩︎