Partials can be paths #389

Merged
merged 2 commits into from Dec 24, 2012

Conversation

Projects
None yet
2 participants
Contributor

leshill commented Dec 13, 2012

Allows partials with slashes, a common partial syntax. For example:

{{> shared/dude}}

Yes, there are workarounds (cf. handlebars_assets), but the slash syntax is not only widely used but maps directly to template hierarchies, for example from the file system. This is incredibly useful when working in a large template set.

Looking at the parser, it is treating the partial name as a context path (an ID). This does allow the not-very-obvious or intuitive literal syntax:

{{> [shared/dude]}}

This commit makes partial names part of the handlebars syntax and deliberately removes the old context literal syntax. If necessary for backward compatibility, that could be brought back with a simple change here

Related issues: #95, #268

leshill added some commits Dec 13, 2012

Partials can be paths
Allows partials with slashes, a common partial syntax. For example:

    {{> shared/dude}}

wycats added a commit that referenced this pull request Dec 24, 2012

@wycats wycats merged commit bf4c813 into wycats:master Dec 24, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment