mquandalle / meteor-jade

The Jade template engine for Meteor/Blaze
http://atmospherejs.com/mquandalle/jade
MIT License
307 stars 39 forks source link

Template names starting with _ #199

Closed talha-asad closed 8 years ago

talha-asad commented 8 years ago

Create a template file, such as _test.tpl.jade. This template cannot be included using +_test but instead with +test. Looks like a bug.

@mquandalle is this, being done on purpose?

mquandalle commented 8 years ago

No, I would merge a PR fixing that.

talha-asad commented 8 years ago

Okay please assign this the bug label and i will try fixing this.

talha-asad commented 8 years ago

Can you give me a pointer, where i should start working on this? I am now testing it with a standard meteor html template, just to make sure this is not being caused by meteor itself.

mquandalle commented 8 years ago

The template name is calculated here.

talha-asad commented 8 years ago

Thanks.

talha-asad commented 8 years ago

Okay this works fine with Meteor simple html templates. I am going to try and fix this in your package.

mquandalle commented 8 years ago

I think you also need to add _ to the regex that detects “user-components” here.

talha-asad commented 8 years ago

Yes makes sense, thanks.

talha-asad commented 8 years ago

Sorry @mquandalle. Seems this works already, it wasn't working for me as i renamed a bunch of template names to start with _ and apparently meteor didn't recompile the spacebar version of it. So the bug is maybe that. And the component regex probably needs to support template names starting with _.

mquandalle commented 8 years ago

Ok, I understand the issue, will work on a fix.

mquandalle commented 8 years ago

Actually underscores are already supported (from the \w symbol in the regex), so it is only a problem of cache invalidation when you renamed your jade files.

talha-asad commented 8 years ago

Makes sense. Thanks for the quick fix :+1: