I was surprised to learn the {% include ... %} does not generate a separate function. If I include the same file into two other templates, the generated code does not get reused but is duplicated. There also does not seem to be a way to pass variables (or context) into an included file, which creates a problem for my usual nav-bar style menus that highlight the currently active page.
I was surprised to learn the
{% include ... %}does not generate a separate function. If I include the same file into two other templates, the generated code does not get reused but is duplicated. There also does not seem to be a way to pass variables (or context) into an included file, which creates a problem for my usual nav-bar style menus that highlight the currently active page.