-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layouts location meaning #17
Comments
Just in Metalsmith's src/layouts directory. You can change it. Any other good default that would be good? https://github.com/RobLoach/metalsmith-jstransformer#configuration |
I am migrating form metalsmith-layouts to metalsmith-jstransformer. That is why, it's interesting, what is the reason of this decision? Why don't your plugin read layouts separate from metalsmith files read? |
Just now was hit by this behavior and default configuration of
src/index.md
Error
With default configuration during 'Render all individual content' phase, current implementation also tries to render |
I think this is a design decision. I think everything that's processed by metalsmith should be in the src directory. The benefits out of this are that you can use YAML front-matter in the layouts, pre-compile them for better performance, and even mix them in with the content, if you really wanted. This isn't stopping you from using something like metalsmith-assets to copy the assets in to have them process with metalsmith-jstransformer though. They just need to become part of the files array before it goes through. Means the plugin doesn't have to read them twice.
Did you move the Moment.js metalsmith plugin before metalsmith-jstransformer? The object isn't there, leads me to believe it wasn't created yet. In your layout, you're using |
Thank you for detailed explanation. It is clear now. As for my error. First yes |
Very cool 👍 What was the new pattern that you used? Out of curiosity. |
Because I consider metalsmith-jstransformer convention my contest file name pattern is |
In #9 I read that process layouts from
src/layouts
is design concept.Could you please explain what is the reason of this decision? What advantages does it give?
The text was updated successfully, but these errors were encountered: