title: How to provide the current route or view to the layout in ExpressJS?
body: <p>I want to be able to dynamically reference JavaScript and Stylesheets depending on which page a user is on in Express.  I thinking the best way to do so (though I'm open to suggestions) is to pass the current view to the layout page. </p>
  
  <p>For example; </p>
  
  <p>Given the url <code>http://example.com/trees</code></p>
  
  <p>I would want to have some logic in layout.jade that said something to the effect of:</p>
  
  <p><code>script(src="/javascripts/{view}.js")</code></p>
  
  <p>Which would get rendered as:</p>
  
  <p><code>&lt;script src="/javascripts/trees.js"&gt;&lt;/script&gt;</code></p>
  
  <p>Any suggestions or best practices for doing this?</p>