2025-06-12
Nunjucks
Nunjucks is a templating language for JavaScript and Node.js from Mozilla, which is relatively similar to Twig in its structure.
We use Nunjucks, with the file extension .njk, in various applications, including Eleventy.
Here is an example of a couple of lines with syntax:
{% extends "base.html" %}
{% block header %}
<h1>{{ title }}</h1>
{% endblock %}
{% block content %}
<ul>
{% for name, item in items %}
<li>{{ name }}: {{ item }}</li>
{% endfor %}
</ul>
{% endblock %}