Create static Site with /blog/ that houses Ghost posts - ISSUE

Hi there,

I have completely converted our static website to handlebars and the Ghost theme I followed this tutorial to create 8 static pages with the hopes of having my regular Ghost index on /blog/ instead of /.

If you look at my routes.yaml file:

    /: home
    /about/: about
    /bm/: bm
    /bookman/: bookman
    /contact/: contact
    /intouch/: intouch
    /intown/: intown
    /search/: search
    /blog/: index

    permalink: /{slug}/
      - index

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

You can see I have created routes for all my static pages. I am trying to route my index.hbs file to /blog/ but all I am seeing on that page is my header and footer.

Any ideas of what I can do to fix this?


Looks like you’re almost there! To move all of your posts to /blog/ instead of / using the index.hbs template, you’ll need to make some adjustments to your collections in routes.yaml, like this:

    permalink: /blog/{slug}/
      - index

You can also remove the /blog/: index line from your routes.

There’s also a tutorial for content collections here, which will be useful if you need to create more than one content collection or filter your collections :)

1 Like

Kym you saved me! Thank you so much!

1 Like