When comparing Nunjucks vs Pug (previously Jade), the Slant community recommends Pug (previously Jade) for most people. In the question“What are the best HTML preprocessors?” Pug (previously Jade) is ranked 1st while Nunjucks is ranked 5th. The most important reason people chose Pug (previously Jade) is:
One of the distinguishing features of Jade is its clean syntax. Elements are created with CSS selector syntax which makes the template consistent with your style sheet and JavaScript element selector library.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Very user friendly
Pro Building blocks for CMS Websites
Another token based system with all of the logic, looping and variable control that other engines provide. But in addition it supports some more advanced page composition elements e.g. block inheritance, includes, layout inheritance, custom tags and macros — all absolutely perfect for a CMS where pages are typically composed of a series of “building blocks”.
Reference:
link
Pro Suppported by Mozilla
Pro Has Jinja2 as role model
Pro Open Source
Pro Clean syntax
One of the distinguishing features of Jade is its clean syntax. Elements are created with CSS selector syntax which makes the template consistent with your style sheet and JavaScript element selector library.
Pro Allows writing inline JavaScript
Jade allows embedding regular JavaScript code directly within the template.
Pro Reuse code in other langauges
In addition to JavaScript, you can reuse Jade templates in Scala, PHP, Ruby, Python and Java.
Cons
Con Seeking new maintainer
Con Unforgiving in case of indentation errors
The structure is entirely determined by the indentation. That means that indentation errors will ruin the end result, often without an easy way to find the error. Indentation errors are easily introduced by copy-pasting, by rearranging code and by working in a team where not everyone uses the same indentation style. (E.g tabs vs. spaces.)