Skip to content

Commit

Permalink
Tell people about the "page.title" shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdub committed Dec 19, 2011
1 parent 5238fa1 commit 4648e79
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.markdown
Expand Up @@ -70,7 +70,8 @@ Page metadata
A YAML header can be provided at the top of any template, defining page metadata. The header is introduced by a first line containing three dashes, and terminated by a line containing three dots.

---
title: "All about fish"
title: "Fish"
subtitle: "All about fish"
...

Metadata provided in the header can be referenced by template content, via the "`page.meta`" Hash:
Expand All @@ -80,9 +81,12 @@ Metadata provided in the header can be referenced by template content, via the "
%title= page.meta["title"]
%body
%h1= page.meta["title"]
%h2= page.meta["subtitle"]

This is especially useful in "layout" templates (see below).


Since the page title is such a common thing to want to specify in the header, it's also available as "`page.title`", as a shortcut (if no explicit title was provided, Pith will guess one from the input file name).

Partials and Layouts
--------------------

Expand Down

0 comments on commit 4648e79

Please sign in to comment.