#16
Views and page templates
Pages and Layouts · Working
What is this skill?
A view is the visual template that renders what users see in the browser. In the prototype kit, views are Nunjucks files in the app/views folder that combine HTML, design system components, and dynamic data. Views use template inheritance ('extends') to share common layouts across pages.
Why is it important?
- Page creation – Views are where you build the actual screens users interact with
- Consistency – All pages automatically share the same layout through inheritance
- Efficiency – Don't repeat header and footer code on every page
- Separation of concerns – Keeping views separate from routes makes code more organised
- Template reuse – Views can extend layouts and include partials
- Maintainability – Change the layout once to update all pages
- Data display – Views receive data from routes and display it dynamically