title: Node.js, Express, EJS - Active class on current page in navigation
body: <p>I'd like to render a 'current' class on each of my navigation links depending on which page I'm on in my layout.ejs template.</p>
  
  <p>Currently, my express controller index looks like this:</p>
  
  <pre><code>// About
  exports.about = function(req, res) {
      res.render('content/about.ejs', {
          title: 'About'
      });
  };
  </code></pre>
  
  <p>And in my layout.ejs I have the following, which I'd like be rendered dynamically.</p>
  
  <pre><code>&lt;ul class="nav" id="nav"&gt;
      &lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li class="current"&gt;&lt;a href="/about"&gt;About&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="/"&gt;Contact&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Any ideas of how to achieve this?</p>