I am a beginner to both web development and node.js. I am trying to build a very basic news website with node.js and express. In the home page, I hope to display some featured news, and in the page "news" I expect to display all the news.
It makes sense that the home page and the "news" page can share the jade code to display news. Using the same routes and db node.js functions to handle news listing in both places seems straightforward to me. I wonder whether there is a good way to share code and reduce code duplication in jade (perhaps like the concept "partial" in ruby on rails)?
Any help or reference links are welcomed. Thanks!