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

Nesting Layouts #145

Closed
rambleraptor opened this issue Nov 1, 2013 · 4 comments
Closed

Nesting Layouts #145

rambleraptor opened this issue Nov 1, 2013 · 4 comments
Labels

Comments

@rambleraptor
Copy link

Forgive me if this is possible already.

It seems like it would be nice to have the ability to nest layouts. For example, in a blog, I may want a post layout that would have title and Disqus comments. That post layout would inherit from my main layout so the site retains its natural look.

@edrex
Copy link
Contributor

edrex commented Nov 6, 2013

See sintaxi/terraform#14

@edrex
Copy link
Contributor

edrex commented Nov 16, 2013

Actually I should answer your question directly @astephen2.

If you use Jade for layouts, you can take advantage of the extends and block keywords. This provides an extremely flexible nested layouts system.

If you want to stick with just Harp and EJS, you can often achieve the same ends that you would through nested layouts by factoring out shared code in your layouts into partials.

@mrchief
Copy link

mrchief commented Mar 8, 2016

But then you get bitten by this: #371

@mrchief
Copy link

mrchief commented Mar 8, 2016

Hey, unfortunately you basically have to choose between Jade’s blocks / extends system or Harp’s implicity _layout / partial system.

Just learnt about this

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