From 52284fd320e30c01c9b05acb5a6767b3dff78076 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 19 Sep 2026 12:51:54 +0200 Subject: [PATCH] [feat] categories: add icons for remaining category tabs (#6759) Icons are provided for the main categories known to us. The distinction between CATEGORY_GROUPS and CATEGORY_NAMES is abandoned in favor of the latter. HINT: we need single-color icons; transparent background and the color must be `currentColor` so that the icons can be used in light/dark themes. The following SVGs from the ionicons had to be revised (use ``currentColor``). - client/simple/src/svg/ionicons/logo-rss.svg - client/simple/src/svg/ionicons/radio-outline.svg - client/simple/src/svg/ionicons/color-palette-outline.svg For the following categories, I did not find any usable icons in Ionicons; new SVGs were created for these categories. - onions: client/simple/src/svg/ionicons/tor-browser.svg - lyrics: client/simple/src/svg/ionicons/song-lyric-music.svg [1] - packages: client/simple/src/svg/ionicons/package_2.svg [1] [1] Based on Google's Material icons: https://fonts.google.com/icons Signed-off-by: Markus Heiser --- .../svg/ionicons/color-palette-outline.svg | 39 +++++++++++++ .../ionicons/information-circle-outline.svg | 33 +++++++++-- client/simple/src/svg/ionicons/logo-rss.svg | 17 ++++++ .../src/svg/ionicons/newspaper-outline.svg | 33 +++++++++-- client/simple/src/svg/ionicons/package_2.svg | 7 +++ .../simple/src/svg/ionicons/radio-outline.svg | 23 ++++++++ .../src/svg/ionicons/song-lyric-music.svg | 11 ++++ .../simple/src/svg/ionicons/tor-browser.svg | 26 +++++++++ client/simple/theme_icons.ts | 16 +++++- .../simple/tools/jinja_svg_catalog.html.edge | 13 ++++- searx/searxng.msg | 56 +++++++++---------- searx/templates/simple/categories.html | 40 ++++++++----- 12 files changed, 258 insertions(+), 56 deletions(-) create mode 100644 client/simple/src/svg/ionicons/color-palette-outline.svg create mode 100644 client/simple/src/svg/ionicons/logo-rss.svg create mode 100644 client/simple/src/svg/ionicons/package_2.svg create mode 100644 client/simple/src/svg/ionicons/radio-outline.svg create mode 100644 client/simple/src/svg/ionicons/song-lyric-music.svg create mode 100644 client/simple/src/svg/ionicons/tor-browser.svg diff --git a/client/simple/src/svg/ionicons/color-palette-outline.svg b/client/simple/src/svg/ionicons/color-palette-outline.svg new file mode 100644 index 000000000..965a0c355 --- /dev/null +++ b/client/simple/src/svg/ionicons/color-palette-outline.svg @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/client/simple/src/svg/ionicons/information-circle-outline.svg b/client/simple/src/svg/ionicons/information-circle-outline.svg index 483062105..f5a513ce3 100644 --- a/client/simple/src/svg/ionicons/information-circle-outline.svg +++ b/client/simple/src/svg/ionicons/information-circle-outline.svg @@ -1,6 +1,31 @@ - - - - + + + + diff --git a/client/simple/src/svg/ionicons/logo-rss.svg b/client/simple/src/svg/ionicons/logo-rss.svg new file mode 100644 index 000000000..061233339 --- /dev/null +++ b/client/simple/src/svg/ionicons/logo-rss.svg @@ -0,0 +1,17 @@ + + + + + diff --git a/client/simple/src/svg/ionicons/newspaper-outline.svg b/client/simple/src/svg/ionicons/newspaper-outline.svg index 5b743865b..280bfc422 100644 --- a/client/simple/src/svg/ionicons/newspaper-outline.svg +++ b/client/simple/src/svg/ionicons/newspaper-outline.svg @@ -1,6 +1,31 @@ - - - - + + + + diff --git a/client/simple/src/svg/ionicons/package_2.svg b/client/simple/src/svg/ionicons/package_2.svg new file mode 100644 index 000000000..563788296 --- /dev/null +++ b/client/simple/src/svg/ionicons/package_2.svg @@ -0,0 +1,7 @@ + + + diff --git a/client/simple/src/svg/ionicons/radio-outline.svg b/client/simple/src/svg/ionicons/radio-outline.svg new file mode 100644 index 000000000..f03a32f29 --- /dev/null +++ b/client/simple/src/svg/ionicons/radio-outline.svg @@ -0,0 +1,23 @@ + + + + + diff --git a/client/simple/src/svg/ionicons/song-lyric-music.svg b/client/simple/src/svg/ionicons/song-lyric-music.svg new file mode 100644 index 000000000..94b4c0bd8 --- /dev/null +++ b/client/simple/src/svg/ionicons/song-lyric-music.svg @@ -0,0 +1,11 @@ + + + diff --git a/client/simple/src/svg/ionicons/tor-browser.svg b/client/simple/src/svg/ionicons/tor-browser.svg new file mode 100644 index 000000000..fb36d6149 --- /dev/null +++ b/client/simple/src/svg/ionicons/tor-browser.svg @@ -0,0 +1,26 @@ + + + + + diff --git a/client/simple/theme_icons.ts b/client/simple/theme_icons.ts index cefb33cc6..3cf530d3b 100644 --- a/client/simple/theme_icons.ts +++ b/client/simple/theme_icons.ts @@ -39,14 +39,17 @@ const simple_icons: IconSet[] = [ alert: "alert-outline.svg", appstore: "apps-outline.svg", book: "book-outline.svg", + camera: "camera-outline.svg", close: "close-outline.svg", download: "download-outline.svg", "ellipsis-vertical": "ellipsis-vertical-outline.svg", "file-tray-full": "file-tray-full-outline.svg", + "file-tray-stacked": "file-tray-stacked-outline.svg", film: "film-outline.svg", globe: "globe-outline.svg", heart: "heart-outline.svg", image: "image-outline.svg", + language: "language-outline.svg", layers: "layers-outline.svg", leecher: "arrow-down.svg", location: "location-outline.svg", @@ -58,13 +61,14 @@ const simple_icons: IconSet[] = [ "navigate-up": "chevron-up-outline.svg", people: "people-outline.svg", play: "play-outline.svg", - radio: "radio-outline.svg", + rainy: "rainy-outline.svg", save: "save-outline.svg", school: "school-outline.svg", search: "search-outline.svg", seeder: "swap-vertical.svg", settings: "settings-outline.svg", - tv: "tv-outline.svg" + tv: "tv-outline.svg", + videocam: "videocam-outline.svg" }, svgo_opts: sxng_icon_opts }, @@ -75,7 +79,13 @@ const simple_icons: IconSet[] = [ base: resolve(HERE, "src/svg/ionicons"), set: { "information-circle": "information-circle-outline.svg", - newspaper: "newspaper-outline.svg" + lyrics: "song-lyric-music.svg", + newspaper: "newspaper-outline.svg", + palette: "color-palette-outline.svg", + package: "package_2.svg", + radio: "radio-outline.svg", + rss: "logo-rss.svg", + tor: "tor-browser.svg" }, svgo_opts: sxng_icon_opts } diff --git a/client/simple/tools/jinja_svg_catalog.html.edge b/client/simple/tools/jinja_svg_catalog.html.edge index 307667403..81b629bc1 100644 --- a/client/simple/tools/jinja_svg_catalog.html.edge +++ b/client/simple/tools/jinja_svg_catalog.html.edge @@ -7,9 +7,18 @@ for the backend. Example output of this EDGE template: --}} {# Catalog of SVG symbols that can be inserted into the HTML output of a Jinja -template. This file from: +template. This file is generated by: + + make static.build.commit + +from template: + + client/simple/tools/jinja_svg_catalog.html.edge + +To modify the icon set, edit the script: + + client/simple/theme_icons.ts - client/simple/tools/icon_catalog.edge.html #} {%- diff --git a/searx/searxng.msg b/searx/searxng.msg index 7670ed129..646b1baba 100644 --- a/searx/searxng.msg +++ b/searx/searxng.msg @@ -11,7 +11,6 @@ from searx.weather import WeatherConditionType __all__ = [ 'CONSTANT_NAMES', 'CATEGORY_NAMES', - 'CATEGORY_GROUPS', 'STYLE_NAMES', 'BRAND_CUSTOM_LINKS', 'WEATHER_TERMS', @@ -26,33 +25,34 @@ CONSTANT_NAMES = { } CATEGORY_NAMES = { - 'FILES': 'files', - 'GENERAL': 'general', - 'MUSIC': 'music', - 'SOCIAL_MEDIA': 'social media', - 'IMAGES': 'images', - 'STOCK_IMAGES': 'stock images', - 'VIDEOS': 'videos', - 'RADIO': 'radio', - 'TV': 'tv', - 'IT': 'it', - 'NEWS': 'news', - 'MAP': 'map', - 'ONIONS': 'onions', - 'SCIENCE': 'science', -} - -CATEGORY_GROUPS = { - # non-tab categories - 'APPS': 'apps', - 'DICTIONARIES': 'dictionaries', - 'LYRICS': 'lyrics', - 'PACKAGES': 'packages', - 'Q_A': 'q&a', - 'REPOS': 'repos', - 'SOFTWARE_WIKIS': 'software wikis', - 'WEB': 'web', - 'SCIENTIFIC PUBLICATIONS': 'scientific publications', + "APPS": "apps", + "BLOGS": "blogs", + "DICTIONARIES": "dictionaries", + "FILES": "files", + "GENERAL": "general", + "ICONS": "icons", + "IMAGES": "images", + "IT": "it", + "LYRICS": "lyrics", + "MAP": "map", + "MOVIES": "movies", + "MUSIC": "music", + "NEWS": "news", + "ONIONS": "onions", + "PACKAGES": "packages", + "Q_A": "q&a", + "RADIO": "radio", + "REPOS": "repos", + "SCIENCE": "science", + "SCIENTIFIC PUBLICATIONS": "scientific publications", + "SOCIAL_MEDIA": "social media", + "SOFTWARE_WIKIS": "software wikis", + "STOCK_IMAGES": "stock images", + "TRANSLATE": "translate", + "TV": "tv", + "VIDEOS": "videos", + "WEATHER": "weather", + "WEB": "web", } STYLE_NAMES = { diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index d3cd0b542..2857c6f32 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -1,20 +1,30 @@ {% from 'simple/icons.html' import icon_big %} {%- set category_icons = { - 'apps': 'appstore', - 'dictionaries': 'book', - 'files': 'file-tray-full', - 'general': 'search', - 'images': 'image', - 'it': 'layers', - 'map': 'location', - 'music': 'musical-notes', - 'news': 'newspaper', - 'radio': 'radio', - 'science': 'school', - 'social media': 'people', - 'TV': 'tv', - 'videos': 'play', -} -%} + "apps": "appstore", + "blogs": "rss", + "dictionaries": "book", + "files": "file-tray-full", + "general": "search", + "icons": "palette", + "images": "image", + "it": "layers", + "lyrics": "lyrics", + "map": "location", + "movies": "videocam", + "music": "musical-notes", + "news": "newspaper", + "onions": "tor", + "packages": "package", + "radio": "radio", + "repos": "file-tray-stacked", + "science": "school", + "social media": "people", + "stock images": "camera", + "translate": "language", + "TV": "tv", + "videos": "play", + "weather": "rainy", + } -%}
{{- '' -}}
{%- if not search_on_category_select or not display_tooltip -%}