Extend the Base in Child Pages
Use extends and fill blocks per page.
Connect a Page to the Base
A child page does not repeat the skeleton. It declares that it extends the base, then fills only the blocks it needs to change. 🔗
The extends Tag
The first line of a child template uses extends to name its parent layout. This tells Jinja2 to inherit the base before rendering.
{% extends "base.html" %}All lessons in this course
- Define a Base Template with Blocks
- Extend the Base in Child Pages
- Include Reusable Partials
- Macros for Repeated Markup