title: Pass variables to base layout from extending pug/jade template
body: <p>I would like to set a class on the body tag by declaring a variable in a template that extends a base layout.</p>
  
  <p>When I try, the <code>body_class</code> variable is <code>undefined</code> in the layout.</p>
  
  <p>It appears the layout is executed before the extending template, or they are executed in different scopes or something.</p>
  
  <p>Is there another way? Would a mixin work here?</p>
  
  <p><strong>_layout.jade:</strong></p>
  
  <pre><code>doctype html
  html(lang="en-au")
      head
          meta(charset="utf-8")
          block css
      body(class=(body_class || "it-did-not-work"))
          block header
          block content
          block footer
  </code></pre>
  
  <p><strong>home.jade:</strong></p>
  
  <pre><code>var body_class = 'i-am-the-home-page'
  extends _layout
  block header
      h1 home
  </code></pre>