Index.hbs into a Blog.hbs, in order to have a home custom page


#1

Hi, there!

What I want:

  • Have a home custom page to be in /
  • Leave all my blog posts into /blog/

I’ve tried to copy the code of index.hbs to a new filled called blog.hbs, but it doesn’t look like the index (with different sizes of cards), the collection looks all plain (same size)

What can you recommend me?

Thanks in advance


#2

Hey Rolando,

Sounds like you want a custom homepage with its own template which can be achieved by editing the routes.yaml file - we have a tutorial about this topic here. Hope this helps :smiley:


#3

Hi, Kym! Thanks for your time! I have been reading the documentation but it’s very technical and I’m new in this.

I’m going to try the following:

routes:
/:
controller: channel
template:
- home

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

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

I’ll let you know the results.

Thanks in advance


#4

This is how i’m seeing my home.hbs (copy of index.hbs)

**Why am i seeing the collection blog with the index.hbs in this format not like the original, although is the same file?

strong text

Thank you!


#5

Hey Rolando!

If you copied the index template to your home.hbs template file then this is expected. Each page in a Ghost theme belongs to a context, and the index context is paired with the home context on the / route :slight_smile:

I noticed that you included the controller: channel property in your routes.yaml configuration, but you have not included any filters for your channel. If your end-goal is to render a filtered selection of your posts on the / route, then I’d also recommend reading this tutorial about content hubs / channels.


#6

Kym, I’m going to review at full detail all the documentation that you passed me.
I want to be able to understand everything, so It would be a pleasure to study this :hearts:

Thank you so much for everything!


#7

Hi again!

Is there a way to have a collection of posts that displays the blog cards exactly as the default index.hbs with different sizes? or this graphical feature is only allowed when this is set as the home page?

I keep seeing blog posts like this although it has the index.hbs