Pages (but not Posts or static homepage) are blank

While setting up my static homepage and routing, I did something causing my pages (but not posts) to appear blank. Posts work fine. My homepage, built on a version of the page template, works fine.

Pages themselves are blank.

Example page:


{{!< default}}

{{> header}}

<main class="wrapper_digitus" role="main">

<article class="article_digitus" role="article" itemscope itemtype="">
	<header class="postheader_digitus">
        <h1 class="posttitle_digitus" itemprop="headline">{{title}}</h1>
        <hr class="pause">
	<div class="postcontent_digitus" itemprop="articleBody">




{{> footer}}


data: page.home
template: home

permalink: /{slug}/ 
template: index

tag: /tag/{slug}/
author: /author/{slug}/

I already recreated the page.hbs file from what was working on the static homepage and post.hbs.

Can anyone provide any guidance on where I might look to troubleshoot next?


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

     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:

      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

That is confusing. Now I don’t feel so bad that I couldn’t figure it out myself.

Thanks, Hannah. Your explanation was super helpful. I’ve got it working with the your first suggestion.