Skip to content
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

Partials can be paths #389

Merged
merged 2 commits into from
Dec 24, 2012
Merged

Partials can be paths #389

merged 2 commits into from
Dec 24, 2012

Conversation

leshill
Copy link
Contributor

@leshill 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

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 handlebars-lang:master Dec 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants