[fix] brands: add variables from build env to jinja templating

We have some variables in the build environment which are also needed in the
templating process.  Theses variables are relavant if one creates a fork with
its own branding.  We treat these variables under the term 'brands'.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-03-25 11:49:33 +01:00
parent 9a2f26d915
commit 04c687403e
7 changed files with 29 additions and 19 deletions

3
searx/webapp.py Normal file → Executable file
View file

@ -57,6 +57,7 @@ from babel.support import Translations
import flask_babel
from flask_babel import Babel, gettext, format_date, format_decimal
from flask.json import jsonify
from searx import brand
from searx import settings, searx_dir, searx_debug
from searx.exceptions import SearxParameterException
from searx.engines import (
@ -427,6 +428,8 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['preferences'] = request.preferences
kwargs['brand'] = brand
kwargs['scripts'] = set()
for plugin in request.user_plugins:
for script in plugin.js_dependencies: