In PieCrust, creating pages is a matter of creating a text file in the correct place with the correct name. This mostly depends on the page sources you’re using, but we can go over how it works for the sources involved in the default content model.
We will also go over the chef prepare command, which semi-automates the
process of creating pages.
All pages sources have a file-system endpoint, which is usually a sub-directory of your website’s root directory. They will look for pages inside that endpoint, and load any file that matches that source’s naming convention.
Generally speaking, page sources will load any files that:
.html extension.site/auto_formats website setting (by
default, those are .md and .textile, for Markdown and Textile formatted
pages respectively).Different sources have different conventions — mostly naming of the page files. We’ll look at how it works for the sources in the default content model. To learn about other sources, see the page sources reference.
When using the default content model, PieCrust will load simple pages out of the
pages/ endpoint. The relative path of a page from the pages/ directory will
be that page’s slug, i.e. its URL, minus the site’s root, and minus any
optional arguments.
Since there are often no arguments, and the default’s site root is /, it’s
pretty much the same as the page’s URL. So a page located at
pages/cooks/ludovic will have an URL of /cooks/ludovic.
Running
chef prepare page cooks/ludovicwill create that page for you, which means you don’t have to bother with creating intermediate sub-directories or whatnot.
When using the default content model, PieCrust will load blog posts out of the
posts/ endpoint. There are different naming conventions available depending on
the site/posts_fs setting:
flat: YYYY-MM-DD_post-slug.extshallow: YYYY/MM-DD_post-slug.exthierarchy: YYYY/MM/DD_post-slug.extWhere:
YYYY, MM, and DD are the year, month, and day of the post,
respectively.post-slug is, well, the post’s slug (i.e. the part of the URL that comes
after the site’s root).ext is an extension that’s either html, or something in the site’s
auto-formats (usually md for Markdown texts and textile for Textile
texts).Running
chef prepare post my-new-blog-postwill create a new blog post with a slug ofmy-new-blog-post, dated today. This makes it quick to write a new blog post!