Add THEME_TEMPLATE_OVERRIDES. Refs 2021

Allow for overriding individual templates from the theme by configuring
the Jinja2 `Environment` loader to search for templates in the
`THEME_TEMPLATE_OVERRIDES` path before the theme's `templates/`
directory.
This commit is contained in:
Pedro H 2016-10-16 15:47:22 +08:00
commit a8555ef976
7 changed files with 49 additions and 0 deletions

View file

@ -700,6 +700,14 @@ Template pages
separate templates from the theme. Example: projects, resume, profile ...
These templates need to use ``DIRECT_TEMPLATES`` setting.
.. data:: THEME_TEMPLATE_OVERRIDES = []
A list of paths you want Jinja2 to search for templates before searching the
theme's ``templates/`` directory. Allows for overriding individual theme
template files without having to fork an existing theme. Jinja2 searches in
the following order: files in ``THEME_TEMPLATE_OVERRIDES`` first, theme's
``templates/``
Metadata
========