-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Make includes directory configurable #115
Conversation
fd6bc68
to
4548434
Compare
Nice approach. One thing that I have thought about was including the possibility to configure different includes. For example, it may be more practical for some users if the css files are in site.use(postcss({ includes: "_css" }); In fact, it's something already implemented for postcss, but not other plugins like nunjucks, eta or pug. I think this is a more flexible solution. The plugins can have the To me, the About the directories that doesn't start with
So, maybe the best approach is doing nothing? Just include in the documentation a text indicating that the includes folder/files should be ignored someway. What do you think? |
- Add site.options.includes - Add site.includes(), like site.src() - Replace the hard coded include paths with site.includes()
I agree the It’s good idea to have the
|
Probably, I'd create the nunjucks instance out of the NunjucksEngine constructor. I like the idea of having the engines as much light as possible, so they can be reused with a custom instance if you want (for example, creating your different nunjucks plugin but reusing the same engine). This is something that I did with markdown engine: https://github.com/lumeland/lume/blob/master/engines/markdown.js (the markdown-it instance is created in the plugin file and passed to the engine in the constructor). |
Okay, I’ll try that later, but feel free to push commit(s) here if you like. |
Thanks for those commits! Added a plugin-level |
Nice! I just commited a change to configure the pug engine, including the basedir (includes) from the plugin. |
This implements the possibility of configuring the includes directory proposed in #111:
Adds a new--includes
CLI option.site.options.includes
and aincludes
option foreta
,nunjucks
andpug
.options
option forpug
.site.includes()
, similar tosite.src()
.site.includes()
.@oscarotero, what do you think? Do we need this?
We should also decide what should happen if the specified includes directory doesn’t start with
_
(or.
). Should we throw an error or just ignore the directory (likesite.ignore(site.includes())
)?