mirror of
https://github.com/searxng/searxng.git
synced 2025-07-15 01:09:21 +02:00
[enh] introduce categories_as_tabs
Previously all categories were displayed as search engine tabs. This commit changes that so that only the categories listed under categories_as_tabs in settings.yml are displayed. This lets us introduce more categories without cluttering up the UI. Categories not displayed as tabs can still be searched with !bangs.
This commit is contained in:
parent
02e9bdf755
commit
8e9ad1ccc2
12 changed files with 82 additions and 29 deletions
|
@ -50,14 +50,11 @@ jinja_contexts = {
|
|||
},
|
||||
'enabled_engine_count': sum(not x.disabled for x in searx.engines.engines.values()),
|
||||
'categories': searx.engines.categories,
|
||||
'categories_as_tabs': {c: searx.engines.categories[c] for c in searx.settings['categories_as_tabs']},
|
||||
},
|
||||
}
|
||||
jinja_filters = {
|
||||
'sort_engines':
|
||||
lambda engines: sorted(
|
||||
engines,
|
||||
key=lambda engine: (engine.about.get('language', ''), engine.name)
|
||||
)
|
||||
'group_engines_in_tab': searx.engines.group_engines_in_tab,
|
||||
}
|
||||
|
||||
# Let the Jinja template in configured_engines.rst access documented_modules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue