- I still need to write some documentation on the new and/or changed features.
- I’m really not good at keeping a single release focused around a small set of consistent new features. I tend to pack different unrelated features mixed with bug fixes as they come to me, and the result is a bit messy.
You can read about the changes in the CHANGELOG, or keep reading for a detailed description of the highlights. Or you can just go and grab it from BitBucket or Github and trust me that it’s awesome! (but wait, you should at least read the first couple sections here below because there are a few breaking changes).
New folder structure
As we get closer to a 1.0 release, I changed the folder structure to make it look more like a genuine application. It used to look like an already installed system (a
_piecrust folder with the code and a sample
website folder), which was nice during early prototyping and development. Now, however, it doesn’t feel right anymore, especially since
chef has evolved into a sophisticated tool.
So the folder structure now has a
bin folder with
chef, the usual
tests folders, and a single
piecrust.php file to include at the root.
For backwards compatibility purposes, the important files are also available at their old location (
piecrust.php) but they will issue a warning message if you use them from there. They will be removed when we hit version 1.0.
There was a few things that didn’t quite make sense that I also fixed, unfortunately resulting in breaking changes:
pretty_urlsare disabled, pages with pagination will have the same first page URL as if they didn’t have sub-pages (e.g.
foo/bar.html). Sub-pages will have URLs like
foo/bar/2.html. This makes URLs more consistent.
- PieCrust now supports extensions other than
.htmlfor pages. Before, you had to make all files in
.htmlextension, and use the
content_typeconfiguration setting in the header to change the output to something else, like
- Now, you can actually create files like
_content/pages/feed.xmland it will be handled correctly. This means
content_typeis now only meant for setting HTML response headers in CMS mode, which makes more sense.
chefcommands had some inconsistently named options: some would have hyphens, some would have underscores, and some would just concatenate words together. I don’t know why I never noticed it until now… In most cases, the old option name is still available, but will issue a warning that it will be removed when we hit version 1.0.
Thanks to the magic of open-source, PieCrust now also supports changing the format of a page right in the middle of the content. This is useful when you’re using a minimalist format like Markdown and just need that extra feature at one point to control some CSS or HTML property without having to write it all verbatim:
So here I am, writing some stuff. It's all _nice_ and _fun_. But then, I need to write a boxed piece of text that will be laid out nicely with CSS. Let's use HAML! <--haml--> .boxed_text#tutorial1 .left.column :markdown This is some **cool stuff** right here! .right.column :markdown Hey, this is nice too! <--markdown--> Ok, back to normal, now. **Whew!**.
Also, if you want to start a content segment using a different format than the one defined for the page, you can append the name of the format you want to use like this:
---newsegment:textile--- Another content segment using **Textile** formatting!
The iterators obtained through
link have a few new tricks:
- You can sort posts and pages with a new
foois the name of a configuration setting in the pages’ or posts’ headers that will be used to order those pages or posts.
- You can now access the content segments of pages and posts you’re iterating on – not just metadata like
- You can use
paginagion.all_page_numbersto get, well, all the page numbers for the current page. You can also use
iis a number) to get the link to a specific page. This will help you build pagination footers more easily.
--fileurls option to
chef bake used to bake a website with absolute local paths for all links created with the
pcurl family of template functions. This made it easy to just bake a site and double-click on the main page to preview it locally without any web server.
It was also flawed, because it meant the site could only be previewed in that exact place on the file-system – you couldn’t give it to a colleague or client to review.
A new option,
--portable, effectively replaces the
--fileurls option (which is now deprecated). It will create relative links (with lots of
../ in them) so that you can move the baked static files around and still have them previewable locally in a browser.
Debug info in CMS mode
For people running PieCrust in dynamic CMS mode, you can set
false in the site configuration to disable the
?!debug feature, which could potentially expose private information to visitors.