RevTree
#20

Nunjucks vs HTML

Pages and Layouts · Working

What is this skill?

Understanding Nunjucks vs HTML means knowing when to use static HTML and when to use Nunjucks templating features like variables, loops, conditionals, and template inheritance to build dynamic pages.

Why is it important?

  • Dynamic content – Nunjucks lets you display different content based on user data
  • Reduce repetition – Use template inheritance and includes to avoid duplicating code
  • Cleaner pages – Conditionals and loops make complex pages easier to manage
  • Design system integration – GOV.UK and NHS.UK macros are written in Nunjucks

Where to learn more