Trouble with setting a static home page

Hello! I am trying to set a static homepage in Ghost with routes.yaml, but it’s giving me some trouble.

I want to set the static page Start as the starting site, but when I visit the site, it just shows the site with no content. Only the footer is visible, which indicates that it can’t grab the content for some reason.

Is there anything I did wrong?

This is what my routes.yaml looks like:

routes:
  /:
    data: page.start
    template: page

collections:
  /blog/:
    permalink: /blog/{slug}/
    template: index

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

Hey marvin, you’ll need to get the content inside page.hbs using {{#page}} - have you got that set up?

Ah, that did the trick. The Theme I have installed used the {{#post}} helper in the page.hbs file :face_with_raised_eyebrow:

Yeah that’s actually a dodgy default which works fine w/ default routing and not with custom routing - I ran into the exact same thing myself just last week :)

We’ll get that improved shortly. Actually it seems like the docs aren’t super clear about this either, I’ll update and make sure that’s specifically mentioned!

1 Like

Ok updated the example here:

https://github.com/TryGhost/docs-api/commit/9cbc1f07e4332039bf7328b15ac7726dadc2e91d

There’s also a mention in the properties section here:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.