shannonmoeller / handlebars-layouts

Handlebars helpers which implement layout blocks similar to Jinja, Nunjucks (Swig), Pug (Jade), and Twig.
http://npm.im/handlebars-layouts
MIT License
361 stars 29 forks source link

Deep "inheritance" #6

Closed shannonmoeller closed 9 years ago

shannonmoeller commented 10 years ago

Need to add support for this:

<!-- layout -->
<!doctype html>
<html>
    <head>
        <title>{{block "title"}}</title>
    </head>
    <body>
        {{block "body"}}
    </body>
</html>
<!-- one-column -->
{{#extend "layout"}}
    {{#append "body"}}
        <article>
            <header>
                {{block "header"}}
            </header>
            {{#block "content"}}
                <p>Nothing to see here.</p>
            {{/block}}
        </article>
    {{/append}}
{{/extend}}
<!-- blog-post -->
{{#extend "one-column"}}
    {{#append "title"}}Hello World{{/append}}

    {{#append "header"}}
        <h1>Hello World</h1>
    {{/append}}

    {{#replace "content"}}
        <p>Lorem ipsum...</p>
    {{/replace}}
{{/extend}}
frank06 commented 10 years ago

+1

aliaksandr-master commented 10 years ago

+1

adamrenklint commented 10 years ago

+1

matthiasmoier commented 10 years ago

+1

shannonmoeller commented 9 years ago

The work on this has been completed and will be a part of the 1.0.0 release.