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

feature: automatic view type detection #889

Open
jonschlinkert opened this issue Aug 10, 2016 · 1 comment
Open

feature: automatic view type detection #889

jonschlinkert opened this issue Aug 10, 2016 · 1 comment
Labels

Comments

@jonschlinkert
Copy link
Member

Currently, all views in a specific collection are assigned the "view types" of the collection. But there is no reason individual views couldn't also/alternatively have other view types. I think the rule would need to be that a view has all of the collection's view types, maybe more, but no less.

If we support that, then we can add support for "automatic type detection", for at least some cases. For example, we know that a view is a layout view type if it has a {% body %} tag, and we know that a view is a block view type if it has blocks. But we couldn't automatically detect partials, or pages - since it would be ambiguous.

Initially I was thinking this is something a user could do with an .onLoad middleware, but I don't think that's an ideal solution. If we instead allow the user to optionally enable auto-detection, we can have built-in caching and detection for views that ensures views of the correct type are used at certain points in the render cycle.

@assemblebot
Copy link

@jonschlinkert Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

If your issue is related to one of the following, please open an issue there:

  • grunt-assemble Issues with using assemble in grunt or the grunt-assemble library.
  • handlebars-helpers Issues with using handlebars helpers from the handlebars-helpers library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants