Change how layout paths are resolved #11

Merged
merged 2 commits into from Jan 16, 2013

Conversation

Projects
None yet
2 participants
@autoric
Contributor

autoric commented Jan 16, 2013

Currently, layout paths are resolved relative the template. This can become a pain for nested views and maintainability. Given an example like:

views/
    index.hbs
    home/
        userpage.hbs
    admin/
        users/
            list.hbs
    layouts/
        default.hbs

These views would respectively use the layout directives. For a lot of views this can be frustrating if I decide I want to refactor the directory structure or whatever.

{{!< layouts/default }}
{{!< ../layouts/default }}
{{!< ../../layouts/default }}

This pull request will add a configuration option "layoutsDir" that all layouts will be resolved against. If that option is not given, it will fallback to current behavior.

mgutz added a commit that referenced this pull request Jan 16, 2013

Merge pull request #11 from autoric/master
Change how layout paths are resolved

@mgutz mgutz merged commit d598656 into barc:master Jan 16, 2013

@mgutz

This comment has been minimized.

Show comment Hide comment
@mgutz

mgutz Jan 16, 2013

Contributor

thanks!

Contributor

mgutz commented Jan 16, 2013

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment