SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
make category order configurable using ui.categories_order
Noémi Ványi640da73a9ea3
diff --git a/searx/settings.yml b/searx/settings.ymlindex 2497a764b..8df151b14 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -24,6 +24,12 @@ ui:default_locale : "" # Default interface locale - leave blank to detect from browser information or use codes from the 'locales' config sectiontheme_args :oscar_style : logicodev # default style of oscar+# categories_order :+# - general+# - files+# - map+# - it+# - science# searx supports result proxification using an external service: https://github.com/asciimoo/morty# uncomment below section if you have running morty proxydiff --git a/searx/webapp.py b/searx/webapp.pyindex f3f5f21b8..46d4e949c 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -355,17 +355,12 @@ def render(template_name, override_theme=None, **kwargs):if (engine_name, category) not in disabled_engines)if 'categories' not in kwargs:- kwargs['categories'] = ['general']- kwargs['categories'].extend(x for x in- sorted(categories.keys())- if x != 'general'- and x in enabled_categories)+ kwargs['categories'] = [x for x in+ _get_ordered_categories()+ if x in enabled_categories]if 'all_categories' not in kwargs:- kwargs['all_categories'] = ['general']- kwargs['all_categories'].extend(x for x in- sorted(categories.keys())- if x != 'general')+ kwargs['all_categories'] = _get_ordered_categories()if 'selected_categories' not in kwargs:kwargs['selected_categories'] = []@@ -443,6 +438,17 @@ def render(template_name, override_theme=None, **kwargs):'{}/{}'.format(kwargs['theme'], template_name), **kwargs)+def _get_ordered_categories():+ ordered_categories = []+ if 'categories_order' not in settings['ui']:+ ordered_categories = ['general']+ ordered_categories.extend(x for x in sorted(categories.keys()) if x != 'general')+ return ordered_categories+ ordered_categories = settings['ui']['categories_order']+ ordered_categories.extend(x for x in sorted(categories.keys()) if x not in ordered_categories)+ return ordered_categories++@app.before_requestdef pre_request():request.start_time = time()