I’ve been using @tommysundstrom’s optional html with nginx to serve up a site without the .html extension and ran into one place that I’ve been unable to remove the .html extension from the way it’s generated for pagination by middleman. I thought using chomp(’.html’) would work but it didn’t fly. This is what I have:
<ul class="portfolio-nav">
<li><a href="<%= current_article.previous_article.try(:url).chomp('.html') %>">Prev</a></li>
<li><a href="<%= current_article.next_article.try(:url).chomp('.html') %>">Next</a></li>
</ul>
Based on the error I get from middleman I can’t tack on a method to the end of (:url). What would be the proper way to implement this?