Pages (but not Posts or static homepage) are blank

For legacy reasons, normal pages in Ghost have all their data associated with a data key post and so they use {{#post}}{{/post}} where the newer dynamic route pages uses {{#page}}{{/page}} by default.

Or another way of putting it is that:

data: page.home is shorthand for

   data: 
     page: page.home

So, home.hbs should use {{#page}}{{/page}}
And page.hbs should use {{#post}}{{/post}}

Alternatively, if you change your routes to this:

routes:
  /:
    data:
      post: page.home
      template: home

You can change the home page data key to post and then consistently use {{#post}}{{/post}} everywhere.

FWIW yes this is daft and confusing and we need to fix it.

1 Like