A
A
Andrew2017-11-03 13:14:38
HTML
Andrew, 2017-11-03 13:14:38

Pug mixin in a mixin?

Hello comrades.
For a complete picture, we need a little imagination, imagine a section with some three identical (size and general essence) tile blocks, each with a different picture, different heading and text.
Since blocks are repetitive, I wanted to create a mixin, something like mixin item(). Since the content in each is different, I thought it was to put inside a mixin with different parameters and attributes, and the output turned out:

mixin item()
  mixin item_img(src, alt)
   img(src=src, alt=alt)
  mixin item_title(title)
   h4= title
  mixin item_text(text)
   p= text

But the record
+item
  +item_img(src, alt)
  +item_title(’Title’)
  +item_text(’Text')

does not give the desired result, it simply does not work. What am I doing wrong or is it not possible at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
drtvader, 2017-11-03
@m1roku

mixin item(src, alt, title, text)
I think this will help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question