How to create a modifiable variable using a single mixin in jade?

0

I have 6 cards to show a title and a list on one side. Since these cards have the same structure, I created a mixin using Jade. Since each card shows a different list, I need to create a different variable for each card to access those strings. Is it possible, and if possible, how can I create an argument that I can modify each time I use the mixin to access the variable I want? Example:

I will have my 6 different variables containing the strings that I want to pass in list form on each card:

-var benefitsCard1 = ['benefit 1', 'benefit 2', 'benefit 3, 'benefit 4'];
-var benefitsCard2 = ['benefit 5', 'benefit 6', 'benefit 7, 'benefit 8'];

...

and in the mixin, where it says benefitsCard1 (last argument), I would like to change to the name of the variable I want to access above, or if possible, create a mixin with an argument in white (type '' ) for when to use the mixin, pass in its place the variable that I want to access. Does anyone know how to do this?

mixin benefits(image, h4, p4, benefitsCard1)
  .col-sm-4
    .benefits__card-front
      img(src='img/' + image + '.svg')
      h4
        | #{strings[''+h4]}
      p4
        | #{strings[''+p4]}
    .benefits__card-back
      h4
        | #{strings[''+h4]}
      ul
        each benefit in benefitsCard1
          li
            p1
             | #{strings[''+benefit]}
    
asked by anonymous 03.12.2018 / 20:39

0 answers