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 mention the
chef prepare command, which semi-automates the
process of creating pages by letting you type a lot less than what would be
otherwise needed to create the correctly named text file in the correct folder.
Generally speaking, you should be able to run
chef prepare -h and figure it
out on your own.
In addition to creating the text file, you can make PieCrust open your favorite text editor too, with the
prepare/editorsite configuration setting. For more information, see the site configuration reference.
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:
- have a
- have an extension listed in the
site/auto_formatswebsite setting (by default, those are
.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.
Default content model pages
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
Since there are often no arguments, and the default’s site root is
pretty much the same as the page’s URL. So a page located at
pages/cooks/ludovic will have an URL of
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
DDare the year, month, and day of the post, respectively.
post-slugis, well, the post’s slug (i.e. the part of the URL that comes after the site’s root).
extis an extension that’s either
html, or something in the site’s auto-formats (usually
mdfor Markdown texts and
textilefor Textile texts).
chef prepare post my-new-blog-postwill create a new blog post with a slug of
my-new-blog-post, dated today. This makes it quick to write a new blog post!