title: Is there any way to if/else a block in jade?
body: <p>I'm trying to made a crude store front app in Express and im trying to set it up so that if a person is logged in so the username is not 'undefined', it shows one block, and if you're logged out it shows another.</p>
  
  <p>Here's my <code>layout.jade</code> file:</p>
  
  <pre><code>doctype 5
  html
    head
      title= title
      link(rel='stylesheet', href='/stylesheets/style.css')
        h1.main= title
          body
            - if (typeof(username) !== 'undefined') {
              block items
            -}
            - else {
              block content
            -}
  </code></pre>
  
  <p>My content block contents.</p>
  
  <pre><code>extends layout
  
  block content
  
    #content
      img#splash(src='images/ninja.png')
  </code></pre>
  
  <p>And my items block.</p>
  
  <pre><code>block items
  
       #items
         h1 Hello (username)
  </code></pre>
  
  <p>When I log in, I just see the pages title (my layout.jade files contents) and not the content of the items.jade file.</p>
  
  <p>Does anyone know why this is? I'm new to Express and can't work it out :/</p>
  
  <p>If I do something like.</p>
  
  <pre><code>- if (typeof(username) !== 'undefined') {
          p test
        -}
        - else {
          block content
        -}
  </code></pre>
  
  <p>Then I can see the text upon logging in.</p>