cyberdelia/django-pipeline — Issue #32: JST Concatenation Strategy 
Author: gerardo
Created: 2011-10-23 23:05:32+00:00
State: open

Currently, the pipeline [documentation](http://readthedocs.org/docs/django-pipeline/en/latest/templates.html#) points out that given a template like `js/templates/photo/detail.jst`, it would be exposed as `JST.photo_detail()`. But as [you can see](https://github.com/cyberdelia/django-pipeline/blob/master/pipeline/compressors/__init__.py#L71), that's not the way it is working right now. The output is the JST object as a hashtable, where the key is the path of the file, using _ instead of / as path separators.

I think the current(but undocumented) way to do it is better, but it should use / instead: `JST['js/templates/photo/detail.jst']`. Or better yet, do like [jammit does](http://documentcloud.github.com/jammit/#jst):

> When including templates from different directories, the common prefix is ignored, and the rest of the path becomes the name of the template:
>
>```yml
javascripts:
workspace:
- app/views/accounts/badge.jst
- app/views/common/dialog.jst
- app/views/common/menu.jst
```
>Then, from your JavaScript:
>
>```javascript
JST['accounts/badge']
JST['common/dialog']
JST['common/menu']
```

Do you agree with this?