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

nested layouts #71

Closed
jonschlinkert opened this issue Feb 20, 2013 · 15 comments
Closed

nested layouts #71

jonschlinkert opened this issue Feb 20, 2013 · 15 comments
Assignees
Labels

Comments

@jonschlinkert
Copy link
Member

Jekyll does this currently. The way it works is you can create a very simple layout that has only the head and body tags, for example. Other layouts will then use that layout as a base, but with additions such as a navbar, footer etc..

For example:

base-layout.hbs

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Document</title>
  </head>
  <body>
    {{> body }}
  </body>
</html>

kitchen-sink-layout.hbs

---
layout: base-layout.hbs

---
{{> navbar }}
{{> body }}
@ghost ghost assigned doowb Feb 20, 2013
@jonschlinkert
Copy link
Member Author

This might actually solve #80 as well. I suggest we implement this feature before 80 as follows:

  • Add a default layout which consists only of {{> body }}. This is something that will not need to be customized by anyone (and I'll explain why), so ideally this would not be a file but would just be hard coded in javascript.
  • If layouts can inherit other layouts, then any additional layouts used would automatically inherit the default layout. Which would have no visible net impact on the user (since the default layout only consists of a body template and would have the effect of transparently "passing through" other layouts)

Make sense? I think this is pretty solid.

@jonschlinkert
Copy link
Member Author

@doowb ping on this, it would help a lot to reduce targets and complexity with sellside.

@Arkkimaagi
Copy link
Contributor

+1 on this

I'm currently building a set of layouts and it seems that I now have to write my code multiple times to achieve this. I'd really appreciate something like this.

@doowb
Copy link
Member

doowb commented Jun 9, 2013

Thanks for pinging this @Arkkimaagi. You seem to have perfect timing since @jonschlinkert and I were just talking about this the other night and we're working on it. I hope to have some of these things finished this weekend.

@Arkkimaagi
Copy link
Contributor

You can take a peek at what I'm working on at the repository for my site. I have a enhancement request related to this issue there: Arkkimaagi/assemble-website-template#10

I have collected a bunch of stuff I've been working on with assemble over there. Some of it is messy and all of it under construction, but it might give you an idea on how I've worked with Assemble. Any improvements and suggestions are very welcome. I think it could be mutually beneficial as most of the ideas and issues I've shared here come from that project and similar ones that I have running.

@doowb
Copy link
Member

doowb commented Jun 10, 2013

Thanks @Arkkimaagi I'll take a look today. I'm also working through the helper loading stuff right now.

@jonschlinkert
Copy link
Member Author

@Arkkimaagi you're doing some interesting stuff with that repo, thanks for sharing a link to it.

@Arkkimaagi
Copy link
Contributor

If there were some problems getting it running, it might be because I'm runnin a modified version of assemble that handles empty files better. I'll do a pull request on that a bit later.

@jonschlinkert
Copy link
Member Author

@Arkkimaagi I just looked through it, I haven't pulled it down yet. K, looking forward to seeing how you resolved the empty files issue. That's actually a handlebars thing, I just usually put a code comment since anything works

@doowb
Copy link
Member

doowb commented Jun 10, 2013

The empty string issue may have been fixed but I'm not sure which version it was fixed in and we had hardcoded a version of handlebars because they had a breaking issue with something else. I think soon they're planning on fixing all their versions and doing an office 1.0(?) release that will hopefully have most of these things fixed.

@Arkkimaagi
Copy link
Contributor

What is the status of this issue? The Handlebars 1.0 release seems to be out with few minor fixes already in it.

@jonschlinkert
Copy link
Member Author

@Arkkimaagi yeah I just did another project that this would be useful on. I'm sure @doowb would help you through it if you want to try doing the code for this.

@Arkkimaagi
Copy link
Contributor

I have no idea where to even start. I have not taken a look at that side of things at all.

@jonschlinkert
Copy link
Member Author

@doowb what are the main challenges of implementing this?

@doowb
Copy link
Member

doowb commented Aug 6, 2013

I think this can be closed now because of PR #250

@doowb doowb closed this as completed Aug 6, 2013
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

3 participants