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

Multiple partials with same file name, in different directories #32

Open
burtyish opened this issue Nov 23, 2015 · 2 comments
Open

Multiple partials with same file name, in different directories #32

burtyish opened this issue Nov 23, 2015 · 2 comments

Comments

@burtyish
Copy link

I'm trying to migrate a large project to assemble. I have two partials named header.hbs, placed in different directories like this:
../partials/foo/header.hbs
../partials/bar/header.hbs

I've tried {{> foo/header }} and {{> 'foo/header' }} but those fail with Warning: The partial foo/header could not be found.

I can see in the verbose output that two partials with name header are created. {{> header }} succeeds, but will always return the second file (probably since it was the last one registered).

How can I reference a specific header partial?

@doowb
Copy link
Member

doowb commented Nov 24, 2015

grunt-assemble will only use the basename of the partial's filepath.

There is a registerPartial option that can be a function that gets the engine (handlebars), filename, and content properties.

This won't really help you here because filename will always be header.

Since we moved the original assemble code into this library, I think we'll consider any PRs that can make this easier and we can use proper semver versioning. Eventually, we'll be using more of the new features in assemble (like renameKey) which takes the entire filepath and allows updating how the key is created.

@burtyish
Copy link
Author

I see.
Thank you for the prompt reply.

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

No branches or pull requests

2 participants