diff --git a/AUTHORS.rst b/AUTHORS.rst index 265a9fd41..766b2973e 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -173,4 +173,5 @@ features or generally made searx better: - Austin Olacsi `` - @micsthepick - Daniel Kukula `` -- Patrick Evans `https://github.com/holysoles` \ No newline at end of file +- Patrick Evans `https://github.com/holysoles` +- shreven ``_ B8B56F6FC0EADCA5B6177BC5F599020F48EE6F97 diff --git a/docs/admin/settings/settings_brand.rst b/docs/admin/settings/settings_brand.rst index 0f1a0d9a9..96329d952 100644 --- a/docs/admin/settings/settings_brand.rst +++ b/docs/admin/settings/settings_brand.rst @@ -11,6 +11,10 @@ docs_url: https://docs.searxng.org public_instances: https://searx.space wiki_url: https://github.com/searxng/searxng/wiki + custom_files: + logo: /path/to/file.png + favicon_png: /path/to/file.png + favicon_svg: /path/to/file.svg ``issue_url`` : If you host your own issue tracker change this URL. @@ -23,3 +27,12 @@ ``wiki_url`` : Link to your wiki (or ``false``) + +``custom_files.logo`` : + Filepath to a custom logo. Be sure it has the right file extension, as that's used to determine the mimetype. + +``custom_files.favicon_png`` : + Filepath to a custom PNG favicon. + +``custom_files.favicon_svg`` : + Filepath to a custom SVG favicon. When using, be sure to also set ``custom_files.favicon_png``, as some browsers still don't support SVG favicons. diff --git a/searx/settings.yml b/searx/settings.yml index 4fad73b40..c9f3e3d4b 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -29,6 +29,12 @@ brand: # links: # Uptime: https://uptime.searxng.org/history/darmarit-org # About: "https://searxng.org" + # custom_files: + # # If using custom logo, be sure to set the right file extension as it's used to determine the mimetype. + # logo: /path/to/file.png + # # For custom favicons, you must include a PNG version, as some browsers still don't support SVG favicons. + # favicon_png: /path/to/file.png + # favicon_svg: /path/to/file.svg search: # Filter results. 0: None, 1: Moderate, 2: Strict diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index b70aaf941..0ed886470 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -152,6 +152,7 @@ SCHEMA = { 'public_instances': SettingsValue((False, str), 'https://searx.space'), 'wiki_url': SettingsValue(str, 'https://github.com/searxng/searxng/wiki'), 'custom': SettingsValue(dict, {'links': {}}), + 'custom_files': SettingsValue(dict, {}), }, 'search': { 'safe_search': SettingsValue((0, 1, 2), 0), diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index c2cbad315..d2b9ab324 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -151,7 +151,6 @@ module.exports = function (grunt) { svgo: ['--config', 'svg4web.svgo.js'] }, files: { - '<%= _templates %>/simple/searxng-wordmark.min.svg': '<%= _brand %>/searxng-wordmark.svg', 'img/searxng.svg': '<%= _brand %>/searxng.svg', 'img/img_load_error.svg': '<%= _brand %>/img_load_error.svg' } diff --git a/searx/static/themes/simple/src/less/index.less b/searx/static/themes/simple/src/less/index.less index 8590d0c3b..758d11eb9 100644 --- a/searx/static/themes/simple/src/less/index.less +++ b/searx/static/themes/simple/src/less/index.less @@ -6,7 +6,11 @@ text-align: center; .title { - background: url('../img/searxng.png') no-repeat; + &.custom_logo { + background-image: url('../../../../custom/logo'); + } + background-image: url('../img/searxng.png'); + background-repeat: no-repeat; min-height: 4rem; margin: 4rem auto; background-position: center; diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 93a1a3902..42c17946f 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -27,9 +27,11 @@ {% block head %} {% endblock %} - - - + + + {% if not get_setting('brand.custom_files.favicon_png', false) or get_setting('brand.custom_files.favicon_svg', false) %} + + {% endif %}
diff --git a/searx/templates/simple/index.html b/searx/templates/simple/index.html index 5c207bbd9..d34609c0b 100644 --- a/searx/templates/simple/index.html +++ b/searx/templates/simple/index.html @@ -2,7 +2,7 @@ {% from 'simple/icons.html' import icon_big %} {% block content %}
-

SearXNG

+

SearXNG

{% include 'simple/simple_search.html' %}
{% endblock %} diff --git a/searx/templates/simple/opensearch.xml b/searx/templates/simple/opensearch.xml index 5176c012c..e1ba83ede 100644 --- a/searx/templates/simple/opensearch.xml +++ b/searx/templates/simple/opensearch.xml @@ -4,7 +4,7 @@ SearXNG metasearch SearXNG is a metasearch engine that respects your privacy. UTF-8 - {{ url_for('static', filename='img/favicon.png', _external=True) }} + {{ url_for('custom', custom_file='favicon_png', filename='img/favicon.png', _external=True) }} {% if opensearch_method == 'GET' %} {% else %} diff --git a/searx/templates/simple/page_with_header.html b/searx/templates/simple/page_with_header.html index 719553a38..5e91878a8 100644 --- a/searx/templates/simple/page_with_header.html +++ b/searx/templates/simple/page_with_header.html @@ -2,6 +2,6 @@ {%- extends "simple/base.html" -%} {%- block header -%} {{- '' -}} - {{- '' -}} + {{- '' -}} {{- '' -}} {%- endblock -%} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 360873c76..023038294 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -2,7 +2,12 @@