title: Jade: modify <head> from any place other than the main page
body: <h1>Update:</h1>
  
  <p>I also posted this question to the Jade GitHub repository. I'm dropping it here too, for future (circular) reference:
  <a href="https://github.com/jadejs/jade/issues/1943" rel="nofollow">https://github.com/jadejs/jade/issues/1943</a></p>
  
  <h1>Original post:</h1>
  
  <p>In a default node + express + jade application, I'm trying to build some common reusable components (menu, footer...) that I can include in some pages. I got stuck while trying to add references to .css or .js files from a block or an included file.
  I want to do this because I don't want to include all the styles and scripts if I don't need them.</p>
  
  <p>The folder structure is something like this:</p>
  
  <hr>
  
  <ul>
  <li>Root
  <ul>
  <li>public
  <ul>
  <li>javascripts
  <ul>
  <li>main.js</li>
  <li>menu.js</li>
  </ul></li>
  <li>stylesheets
  <ul>
  <li>main.css</li>
  <li>menu.css</li>
  </ul></li>
  </ul></li>
  <li>views
  <ul>
  <li>shared
  <ul>
  <li>layout.jade</li>
  <li>menu.jade</li>
  <li>footer.jade</li>
  </ul></li>
  <li>index.jade</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <hr>
  
  <p>The layout.jade file:</p>
  
  
  
  <pre><code>doctype html
  html
    head
      title= title
      link(rel="stylesheet", href="stylesheets/main.css")
      script(src="javascripts/main.js")
    body
      block content
  </code></pre>
  
  
  
  <p>The index.jade file:</p>
  
  
  
  <pre><code>extends shared/layout
  
  block content
    h1= title
    p Welcome to #{title}
  </code></pre>
  
  
  
  <p>In menu.jade there is some code that needs the menu.css and menu.js files.</p>
  
  <p>Now I need a way to add those files to the <code>&lt;head&gt;</code> of the page only when I use the menu.jade file.</p>
  
  <p>I started using Jade a few hours ago so it's very possible that I missed something in the documentation.</p>
  
  <p>Thank you!</p>