Closed fephil closed 8 years ago
Hmm strange, the metadata should just be available everywhere. Might be a context problem if you're using a language like handlebars: http://assemble.io/docs/Context.html
Do you have an example repo that implements your plugin?
I'll produce a more stripped back example ASAP and get back to you. The reason why I mentioned it here with was that metalsmith-in-place works fine so it seemed strange.
I'll take a look into the context as well.
Ok. Well then it could be the registration of the partials (which is slightly different), or that metalsmith-in-place processes templating syntax in files from src
, which metalsmith-layouts
does not.
If the rest of the partial is rendering correctly it should not be the registration.
The rest of the partial is rendering correctly. I took a look at context and I don't think it applies in this situation (but I could be wrong with that).
Hope this is clear, let me know if I can do anything else.
Your setup is rather unusual, instead of putting your layouts and partials in src I'd put them at the root. src
is only for files that should end up in dist
. See this example.
I'd refactor to that structure and see if you still have the problem. I'm still suspecting that it's because metalsmith-layouts doesn't process templating syntax for anything in src, but refactoring to the recommended structure would rule out some other possible causes.
That makes sense. I'll experiment with this in the next few days and report back/close.
Thanks for looking into this.
Hi. This was caused by an error in my plugin sadly. Everything now works as expected. Thanks.
Ah ok cool, thanks for reporting back! 👍
Hi,
I have built my own plugin for adding metadata from multiple json files and it works fine on pages but doesn't work when references are in a partial.
Link to plugin: http://github.com/fephil/metalsmith-data-directory Link to example workflow: http://github.com/fephil/foley
I tried looking at the layouts code but I didn't see anything out of the ordinary.
Thanks