title: Pug - mixin with conditional .json object
body: <p>I'm trying to use a conditional (if exists an object at a external .json), but pug doesn't recognize it.</p>
  
  <p>So, my json file is something like this:</p>
  
  <pre><code>{
    "portfolioItems": [object1: {
        objectA { ...
        },
        objectB { ...
        },
        "buttons": [{
          key: value
        }, {
          key: value
        }]
      }, object2: {
        objectA { ...
        },
        objectB { ...
        }], object3: {
        objectA { ...
        },
        objectB { ...
        }
      }
    }
  }
  </code></pre>
  
  <p>Basically, I need to create an extra div for "object 1" (buttons).</p>
  
  <pre><code>mixin portfolio(css, image, title, description)
      div(class= "item " + css)
          .wrap-img
              img(src= assets + "img/home/" + image)&amp;attributes(attributes)
          .wrap-text
              h3= title
              p= description
              if home.portfolioItems.buttons
                  div.buttons
                      each val in home.portfolioItems.buttons
                          a(href= val.link, target="_blank")
                              img(class= val.className, src= assets + "img/stores/" + val.image)
  
  div.portfolio--items
              - var projects = home.portfolioItems;
              each item in projects
                  +portfolio(item.class, item.image, item.title[lang], item.description[lang])(alt= item.title[lang], title=item.title[lang])
  </code></pre>
  
  <p>Pug can access to "home.portfolioItems.buttons", but it can't do a conditional inside a mixin? Because I can run it outside (but I don't want it).</p>
  
  <p>Thanks in advance. Sorry any mistake in english. ;)</p>