It’s been long overdue, since PieCrust 1.0 was released more than 4 months ago, but at last it’s here: PieCrust 1.1!
Every time I figure I will go with a “release small, release often” kind of philosophy, I still end up with more of a “wait, I’ll just get this last feature ready first” kind of vicious circle… sigh.
Anyway, grab the new release, or keep reading if you want to know about the most important changes. As always, big thanks go to the people who reported bugs and/or helped fix them, or generally participated in the evolution of PieCrust.
Removing deprecated stuff
The first, most important change is that anything that was marked as deprecated, and that usually triggered a warning message if you used it, has been removed. So if you’re still using it, it will just break or, worse, silently do something else.
Make sure you don’t have any of those warnings before you update.
If you’re running PieCrust from an installed binary (a
.phar file), you will be able to update it easily with the
chef selfupdate command… well, not this time (you’ll have to re-run the installer), but next time!
By default, the installer gets you the
stable version of PieCrust so if you run the
selfupdate command, it will always get you the latest
stable. But you could also switch to the
master branch (where things are in development) by running
chef selfupdate master. Running
selfupdate (with no argument) from now on would get you the latest
master version until you switch back with
chef selfupdate stable.
I hope this will encourage people to update more often, and to not be afraid to try things out on the
Also, it’s probably not working 100% so make sure you report any issues with the self-updater 🙂
Post iterator improvements
The post iterator, the thing you get when you want to loop over
site.pages, has a few new tricks:
- Each page object that it returns now has access to the
assetsof that page. This is pretty handy if you want to display thumbnails or something.
- The iterator itself now has a few “magic” functions to make simple filtering easier and faster to do. You can use
has_foo(value)directly on the iterator to filter pages that have the
foosetting set to
value, or to an array that contains
valuerespecively. This saves you from having to use
filter()and define a filter in the header.
You likely have something in your website layout that has to be computed for each page, but ends up being the same all the time during a single bake operation. To speed this up, there’s a new
pccache operator that you can use.
Check out the documentation, with an example where it’s used to only compute a tag cloud in a sidebar once per bake. That example is incidentally from my own blog, and it cut the baking times in half… so yeah, I highly recommend it.
New baking infrastructure
PieCrust is now using a brand new system to keep track of what it’s baking now, compared to what was baked last time. This means that it’s now possible to delete files that we know we created last time, but are not valid anymore:
- A page or asset that was deleted.
- A page that doesn’t generate as many sub-pages as before.
- A whole bunch of files that moved because the
post_url, or some other URL-generation setting, changed.
A few other noteworthy changes:
.textilefile extensions are now added to the
auto_formatsby default, which means any file (page or blog post) with that extension will be treated as Markdown or Textile respecitively.
- The concept of “variants”, i.e. different versions of your website’s configuration, are now generalized to the whole of
chef. See the documentation about it.
- There’s no sample website anymore. If you’re feeling nostalgic, however, you can get back that ugly piece of blue as a theme.