diff options
Diffstat (limited to 'searx/webapp.py')
| -rwxr-xr-x | searx/webapp.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index ff4bf694c..94d421eb0 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -174,6 +174,12 @@ _category_names = ( gettext('science') ) +_simple_style = ( + gettext('auto'), + gettext('light'), + gettext('dark') +) + # timeout_text = gettext('timeout') parsing_error_text = gettext('parsing error') @@ -413,6 +419,16 @@ def _get_enable_categories(all_categories): return [x for x in all_categories if x in enabled_categories] +def get_pretty_url(parsed_url): + path = parsed_url.path + path = path[:-1] if len(path) > 0 and path[-1] == '/' else path + path = path.replace("/", " › ") + return [ + parsed_url.scheme + "://" + parsed_url.netloc, + path + ] + + def render(template_name, override_theme=None, **kwargs): # values from the HTTP requests kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint @@ -452,6 +468,7 @@ def render(template_name, override_theme=None, **kwargs): kwargs['searx_version'] = VERSION_STRING kwargs['searx_git_url'] = GIT_URL kwargs['get_setting'] = get_setting + kwargs['get_pretty_url'] = get_pretty_url # helpers to create links to other pages kwargs['url_for'] = url_for_theme # override url_for function in templates |