How to view the post-card (data) of the custom blog page (index.hbs)? - Handlebars

Hello @DavidDarnes and Team,

I continue in my effort to build my personal blog, and I have come across a doubt, which I cannot decipher. I want to personalize my website, with a personalized home. To do this, I modified the routes.yaml file, built the home.hbs page, assigned the routes in the menu correctly (back-end) and managed to establish the connection. But, I can’t discover the assignment of routes.yaml data, nor the structure that I need within index.hbs so that the {{#foreach posts}}{{> "post-card"}}{{/foreach}} are displayed correctly (Currently, it disappears, it looks blank.). I would be very grateful if you could help me discover what I am failing.

Current routes.yaml file

routes:

collections:
  /:
    permalink: /{slug}/
    data: page.home
    template: home

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

taxonomies:

Current index.hbs file

{{!< default}}

<main>
    <div class="container">
        <h2>Personal title</h2>
        {{#foreach posts}}
            {{> "post-card"}}
        {{/foreach}}

        {{pagination}}
    </div>
</main>

Thanks a million in advance. :surfing_man:

Jesús.

I think I have solved it, I am very persistent. :sweat_smile:

As soon as everything is fixed, I will upload the whole process in detail, for future applications.

1 Like

Sounds like your persistent has paid off! Yes, please do share what you make and how you did it with the community :rainbow: