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


#1

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:

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

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

taxonomies:
  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?


#2

Hey,

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:

collections:
  /blog/:
    permalink: /blog/{slug}/
    template:
      - 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 :slight_smile:


#3

Kym you saved me! Thank you so much!