Browse Source

[feat] footer: support for custom entries

Bnyro 1 year ago
parent
commit
7e1b5f6cc8
3 changed files with 8 additions and 0 deletions
  1. 4 0
      searx/settings.yml
  2. 1 0
      searx/settings_defaults.py
  3. 3 0
      searx/templates/simple/base.html

+ 4 - 0
searx/settings.yml

@@ -19,6 +19,10 @@ brand:
   public_instances: https://searx.space
   public_instances: https://searx.space
   wiki_url: https://github.com/searxng/searxng/wiki
   wiki_url: https://github.com/searxng/searxng/wiki
   issue_url: https://github.com/searxng/searxng/issues
   issue_url: https://github.com/searxng/searxng/issues
+  # Custom entries in the footer: [title]: [link]
+  # custom:
+  #  About instance: "https://searxng.org"
+  #  Instance admin: "https://searxng.org"
 
 
 search:
 search:
   # Filter results. 0: None, 1: Moderate, 2: Strict
   # Filter results. 0: None, 1: Moderate, 2: Strict

+ 1 - 0
searx/settings_defaults.py

@@ -151,6 +151,7 @@ SCHEMA = {
         'docs_url': SettingsValue(str, 'https://docs.searxng.org'),
         'docs_url': SettingsValue(str, 'https://docs.searxng.org'),
         'public_instances': SettingsValue((False, str), 'https://searx.space'),
         'public_instances': SettingsValue((False, str), 'https://searx.space'),
         'wiki_url': SettingsValue(str, 'https://github.com/searxng/searxng/wiki'),
         'wiki_url': SettingsValue(str, 'https://github.com/searxng/searxng/wiki'),
+        'custom': SettingsValue(dict, {}),
     },
     },
     'search': {
     'search': {
         'safe_search': SettingsValue((0, 1, 2), 0),
         'safe_search': SettingsValue((0, 1, 2), 0),

+ 3 - 0
searx/templates/simple/base.html

@@ -77,6 +77,9 @@
         {% if get_setting('general.contact_url') %}
         {% if get_setting('general.contact_url') %}
         | <a href="{{ get_setting('general.contact_url') }}">{{ _('Contact instance maintainer') }}</a>
         | <a href="{{ get_setting('general.contact_url') }}">{{ _('Contact instance maintainer') }}</a>
         {% endif %}
         {% endif %}
+        {% for title, link in get_setting('brand.custom').items() %}
+        | <a href="{{ link }}">{{ title }}</a>
+        {% endfor %}
     </p>
     </p>
   </footer>
   </footer>
   <!--[if gte IE 9]>-->
   <!--[if gte IE 9]>-->