Adjusting page routes
Table of contents

A common pattern when creating a custom home page is to move the page where all your posts are listed to another page. To change where your post list gets rendered re-open your routes.yaml file and locate the collections section. Collections represent groups of posts, the default being all posts.

Ammend the collection

Amend the collections section to the following:

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

Similar to setting the home page data before we're selection the "/blog/" URL and allocating the default collection to that URL, we're also adjusting the permalink of the singular posts to be prefixed with "/blog/" to ensure a consistent URL pattern.

Summary

Nice work! You've figured out how to create a custom home page for your Ghost site, where you can render any content and design required from your theme.

There's many ways in which you can extend on the concepts shown above. Check out our documentation on handlebars theming as well as how to allocate data and templates to routes using the routes yaml file. Plus you can get involved with our developer community by joining our official forum. ✌️