Mercurial > piecrust2
changeset 263:a68e207ca406
docs: Still adding more pages.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 24 Feb 2015 22:07:11 -0800 |
parents | 61145dcd56e0 |
children | 74bea91c9630 |
files | docs/docs/02_general/03_website-configuration.md docs/docs/03_content.md docs/docs/03_content/01_creating-pages.md docs/docs/03_content/02_page-configuration.md docs/docs/99_reference.md docs/docs/99_reference/02_page-configuration.md |
diffstat | 6 files changed, 188 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/docs/02_general/03_website-configuration.md Tue Feb 24 08:06:25 2015 -0800 +++ b/docs/docs/02_general/03_website-configuration.md Tue Feb 24 22:07:11 2015 -0800 @@ -28,6 +28,9 @@ section. Other settings, like formatter or template engine specific settings, will be found in other sections. +You can see all the available settings on the [website configuration reference +page][wc] [yaml]: http://en.wikipedia.org/wiki/YAML +[wc]: {{docurl('reference/website-configuration')}}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/docs/03_content.md Tue Feb 24 22:07:11 2015 -0800 @@ -0,0 +1,16 @@ +--- +title: Content +--- + +This section of the documentation explains how to write, or otherwise create and +us, content for PieCrust websites -- pages, layouts, assets, etc. If however you +want to *define* what *types* of content your website will have in the first +place, you may want to read up on the [content model documentation][cm]. + +[cm]: {{docurl('content-model')}} + + +{% for part in family.children %} +* [{{part.title}}]({{part.url}}) +{% endfor %} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/docs/03_content/01_creating-pages.md Tue Feb 24 22:07:11 2015 -0800 @@ -0,0 +1,67 @@ +--- +title: Creating Pages +--- + +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][src] +you're using, but we can go over how it works for the sources involved in the +[default content model][dcm]. + +We will also go over the `chef prepare` command, which semi-automates the +process of creating pages. + + +[src]: {{docurl('content-model/sources')}} +[dcm]: {{docurl('content-model/default-model')}} + + +## Overview + +All pages sources have a _file-system endpoint_, which is usually a +sub-directory of you 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 `.html` extension. +* have an extension listed in the `site/auto_formats` website setting (by + default, those are `.md` and `.textile`, for Markdown and Textile formatted + pages respectively). + + +## Simple 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 +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/ludovic` will create that page for you, which +> means you don't have to bother with creating intermediate sub-directories or +> whatnot. + + +## Blog posts + +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.ext` +* `shallow`: `YYYY/MM-DD_post-slug.ext` +* `hierarchy`: `YYYY/MM/DD_post-slug.ext` + +Where: + +* `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). +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/docs/03_content/02_page-configuration.md Tue Feb 24 22:07:11 2015 -0800 @@ -0,0 +1,40 @@ +--- +title: Page Configuration +--- + +Each page can have a _configuration header_ at the top of the file, which is +used to both customize various aspects of the page, and define metadata on the +page. + +The configuration header must come first in the page's file, and will be +enclosed between 2 lines with 3 dashes: + + --- + config: goes here + --- + text goes here + +The configuration header, just like the [website configuration][wc], is written +in [YAML][]. + +[yaml]: http://en.wikipedia.org/wiki/YAML +[wc]: {{docurl('general/website-configuration')}} + + +For example, the most common pieces of metadata to set on a page are the page's +title, and the layout template to use for it: + + --- + title: Rhubarb Pie Recipe + layout: recipe + --- + <recipe goes here> + + +You can see all the available settings on the [page configuration reference +page][pc], but you will probably also set lots of custom metadata on your pages. +The `title` setting is actually not used by PieCrust itself, but it's a very +common one, and it's used by the default theme. + +[pc]: {{docurl('reference/page-configuration')}} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/docs/99_reference.md Tue Feb 24 22:07:11 2015 -0800 @@ -0,0 +1,11 @@ +--- +title: "Appendix: Reference" +--- + +This appendices give an exhaustive list of settings and features available for +PieCrust websites. + +{% for p in family.children %} +* [{{p.short_title}}]({{p.url}}) +{% endfor %} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/docs/99_reference/02_page-configuration.md Tue Feb 24 22:07:11 2015 -0800 @@ -0,0 +1,51 @@ +--- +title: "Appendix 2: Page Configuration Reference" +short_title: Page Configuration +--- + +This is a list of the settings handled by PieCrust in a page's configuration +header. + +* `blog`: Alias of the `source` setting, to make it easier to remember when + using the default content model. + +* `cache_time`: Specifies the value for the `Cache-Time` HTTP header when this + page is served in CMS mode. + +* `category`: Specifies the optional category that the page is part of. This is + not strictly speaking used by PieCrust itself, but is used by the default + content model. + +* `content_type`: Specifies the value for the `Content-Type` HTTP header when + this page is served in CMS mode. + +* `date`: Sets the date of the page. Note that some sources, like the blog posts + sources, already set the date using the page's filename. + +* `format`: Specifies what formatter to use to render this page. Defaults to + `site/default_format`, which defaults to Markdown. + +* `items_per_page`: Defines how many items to include per page when using the + `pagination` data endpoint. + +* `layout`: Specifies what layout to use to render this page. Defaults to + `default`. + +* `posts_per_page`: Alias of the `items_per_page` setting. + +* `source`: Defines what page source to use with the `pagination` data endpoint. + +* `tags`: An array of strings that represents labels the page is part of. This + is not strictly speaking used by PieCrust itself, but is used by the default + content model. + +* `template_engine`: Specifies the template engine to use to render this page. + Defaults to `site/default_template_engine`, which defaults to Jinja2. + +* `title`: Defines the title of the page. This is not strictly speaking used by + PieCrust itself, but is used by the default theme. + +* `time`: Sets the time of the page. This can be used to complement the `date` + setting, whether it was set through the configuration header, or by the + source. +