I have a static website using handlebars and metalsmith. I can create a collection
called carriers
from my metalsmith config file but the plugin pattern
ignores the markdown files so carriers
is always empty
My JS file has metalsmith config as follows
...//other metalsmith plugins
.use(
collections({
carriers: { pattern: '**/*.md' }
})
)
.use(markdown())
.use(
layouts({
engine: 'handlebars',
directory: './src/layouts',
partials: './src/partials'
})
)
...//other metalsmith plugins
And my carriers.hbs
contains the following
<section id="carriers" class="integrations">
<div class="cards">
{{log collections}}
{{#each collections.carriers }}
<h5>{{this.title}}</h5>
{{/each}}
</div>
</section>
The {{log collections}}
Handlebars built-in helper logs this { carriers: [ metadata: undefined ] }
and the generated html file looks like this
<main>
<section id="carriers" class="integrations">
<div class="cards">
</div>
</section>
</main>
So what am I missing here?