Closed marvinhuebner closed 7 years ago
Front Matter only works on pages.
In Handlebars, partials use the same context (i.e., variables) as the context in which they were included. So, when you use a partial in a page, you have access to all the same variables you'd have in that page.
It's not possible to change the default context for a partial, which means we can't add new variables like that through Front Matter. So unfortunately this won't be possible.
I'd recommend storing the variable in a data file, called something like assets.yml
. Any future paths you need to reuse could be stored there as well.
Alright.
To store the variable in a data file looks a good alternative. Thanks for the hint!
I Would like to use front matter variables in a partial.
My panini template looks like:
And the output looks like this:
So i think he ignores the front matter part in partials.
Is this a known bug or a maybe this feature is not included at all?
Thank you in advance.