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

Mixin blocks from Pug or mixins are parameters #67

Open
fanmanpro opened this issue May 4, 2018 · 0 comments
Open

Mixin blocks from Pug or mixins are parameters #67

fanmanpro opened this issue May 4, 2018 · 0 comments

Comments

@fanmanpro
Copy link

I'm trying to achieve something using Amber that I regularly used in Pug. It would be best described as an example from the Pug documentation:

Mixins can also take a block of Pug to act as the content:

mixin article(title)
  .article
    .article-wrapper
      h1= title
      if block
        block
      else
        p No content provided

+article('Hello world')

+article('Hello world')
  p This is my
  p Amazing article

The resulting HTML:

<div class="article">
  <div class="article-wrapper">
    <h1>Hello world</h1>
    <p>No content provided</p>
  </div>
</div>
<div class="article">
  <div class="article-wrapper">
    <h1>Hello world</h1>
    <p>This is my</p>
    <p>Amazing article</p>
  </div>
</div>

I tried the same code with Amber but it just ignores it.

I also tried sending mixins as parameters of a mixin. This also doesn't seem possible:

 +header("Header Text")        
 +twocolumns(+header, +header) 

Any workaround for this?

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

1 participant