Its surprising to see but nevertheless a very important development in web development, to build websites with different components. Well, to understand this, you have to imagine a page and then another page and then yet another page. Building pages one by one can get quite tedious. Building a website with components essentially implies that you are building separate components, like a call-to-action form, a search form, as separate components and then just piecing them together with those components.
Let’s look at it from the version of a Microsite. It doesn’t require a sophisticated CMS that handles hundreds of different pages. It doesn’t even require any Java framework for its interactivity. All it needs is a set of pages with the same layout. If you are looking at HTML as a solution, you’re not going to find it there. The next natural choice would be PHP language but static sites don’t support PHP so Nunjucks comes to the rescue. When you are looking to create a layout, you are essentially looking at different elements of that layout including the header, footer.
If we were to continue comparing, Nunjucks also allows for client-side browser rendering, something which you won’t be offered by jinja2. This allows you to pre-render complicated pages and factor in any changes in data by using the same templates that you have used for anything else.