-
Notifications
You must be signed in to change notification settings - Fork 7
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
Load paths for partials #104
Comments
ericf/express-handlebars#70 cleared the way for this yeah? Let's do it! |
Been playing with this today, there are multiples ways this can be done:
Thoughts? Solution 2 sounds like a good plan, dev-wise... |
Turns out adding a dir-specific caching option to express-handlebars is pretty easy. The first page load after Solidus is started can be slow (5-6 seconds here), but the next page loads are as fast as usual. I think we have a winner, unless you had other ideas? |
Sounds good to me, might want to run it by the author (you'll be submitting another PR?) in case we're overlooking some horrible detail. Syntax-wise it feels similar to requiring modules otherwise, which is nice. |
Yes I'll submit another PR, or fork the repo if he doesn't accept it. But the guy seems pretty responsive lately, so it should be fine. |
I bet.. Yahoo just killed the project he works on (YUI). |
What kind of internet stalker are you... |
He's not as bad as me :) |
What is this stalker accusation meme! I am merely plugged in 🔌 |
After we get #103 sorted out, the next step is the distribution of blocks. I’m hoping to use npm for this, which will allow blocks to define versions and asset dependencies. The details of how the files will be organized still needs to be worked out but for any CSS/JS assets the plan is to define
node_modules
as a load path for Sass. Browserify supports npm module names, etc. viarequire.resolve()
. Despite the documentation, it appears that express3-handlebars can also search multiple paths for templates.So we need a way to define additional load paths for partials and add them to the
partialsDir
array before setting the module’s configuration. It’s likely that these paths won’t be recursively searched for templates so we’d likely need to add each module directory where a block exists, and directories therein if the template isn’t in the root (it likely will be). The partials should be namespaced by their module name but I suspect they won’t be if the scope is being set to the module directory. So some further work may be required to perhaps do something like gather up all templates from identified directories and pass a temporary/hidden location to the array.Ultimately referencing such templates should look like this:
i.e.
We’ll also be able to pass arguments for some customization possibilities.
The text was updated successfully, but these errors were encountered: