Use: {{#is "page"}}{{/is}}
to detect this context
page
context. The page
context is not set on posts, which uses the post
context instead.
/:slug/
. This cannot be customised, unlike post permalinks.
post.hbs
and an optional page.hbs
template can be used.
Custom templates for specific pages are determined using page-:slug.hbs
, with the :slug
matching the static page’s slug.
For example, if you have an ‘About’ page with the url /about/
, adding a template called page-about.hbs
will cause that template to be used instead of page.hbs
, or post.hbs
.
These templates exist in a hierarchy. Ghost looks for a template which matches the slug (page-:slug.hbs
) first, then looks for page.hbs
and finally uses post.hbs
if neither is available.
page
context provides access to the post object which matches the route. A page is just a special type of post, so the data object is called a post, not a page. As with all contexts, all of the @site
global data is also available.
When outputting the page, the block expression {{#post}}{{/post}}
is used to drop into the post scope and access all of the attributes. All of the data available for a page is the same as the data for a post.
false
true
if the post is a static page, defaults to false
{{#post}}{{/post}}
block expression is used to theme a static page. Once inside of the page, you can use any of these useful helpers (and many more) to output your page’s data:
{{title}}
, {{content}}
, {{url}}
, {{author}}
, {{date}}
, {{excerpt}}
, {{img_url}}
, {{post_class}}]
, {{tags}}
.