Closed spacedawwwg closed 8 years ago
Some options:
1) Use partial parameters:
<!-- someFile.html -->
{{> somePartial title=frontMatter.title}}
<!-- somePartial.hbs -->
{{title}}
2) Use the @file
reference:
<!-- someFile.html -->
{{> somePartial}}
<!-- somePartial.hbs -->
{{@file.data.frontMatter.title}}
3) Use the handlebars-layouts
embed
helper instead of the partial syntax:
<!-- someFile.html -->
{{{embed "somePartial"}}}
<!-- somePartial.hbs -->
{{frontMatter.title}}
Closing due to inactivity and no similar reported bugs. Feel free to reopen if you're still having issues!
Sorry for not responding. Using partial parameters worked for me, the @file reference didn't.
Happy using partial parameters though.
is there a way to access front matter from within a partial?
In the layout I can access
{{frontMatter.title}}
but when I try the same from within a partial it does not work?I have also tried
{{../frontMatter.title}}
to no prevail.Is there any way to do this at all?