From 841512a5352719e637e40090d2ae67fe111aa1ab Mon Sep 17 00:00:00 2001 From: Gnkalk Date: Mon, 17 Feb 2025 19:46:28 +0330 Subject: [PATCH] Update favicon, instance name, and theme settings - Change instance name to "Gitee" in settings - Enable image proxy by default - Add dark mode favicon and update favicon SVG files - Implement dark mode color fix mixin in SCSS - Update base template to support dark mode favicon - Add query title option in results template --- searx/settings.yml | 4 +-- searx/static/img/favicon-dark.svg | 17 +++++++++ searx/static/img/favicon.svg | 18 +++++++++- searx/static/img/logo.svg | 19 +++++++++- .../static/themes/smart/src/scss/mixins.scss | 8 +++++ searx/static/themes/smart/src/scss/style.scss | 4 +++ searx/templates/smart/base.html | 35 ++++++++++++++++--- searx/templates/smart/results.html | 3 +- 8 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 searx/static/img/favicon-dark.svg diff --git a/searx/settings.yml b/searx/settings.yml index 2c92046a5..771cfbfb4 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -2,7 +2,7 @@ general: # Debug mode, only for development. Is overwritten by ${SEARXNG_DEBUG} debug: false # displayed name - instance_name: "SearXNG" + instance_name: "Gitee" # For example: https://example.com/privacy privacypolicy_url: false # use true to use your own donation page written in searx/info/en/donate.md @@ -97,7 +97,7 @@ server: secret_key: "ultrasecretkey" # Is overwritten by ${SEARXNG_SECRET} # Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY} - image_proxy: false + image_proxy: true # 1.0 and 1.1 are supported http_protocol_version: "1.0" # POST queries are more secure as they don't show up in history but may cause diff --git a/searx/static/img/favicon-dark.svg b/searx/static/img/favicon-dark.svg new file mode 100644 index 000000000..e432f07cb --- /dev/null +++ b/searx/static/img/favicon-dark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/searx/static/img/favicon.svg b/searx/static/img/favicon.svg index 262414509..4b0f2eb60 100644 --- a/searx/static/img/favicon.svg +++ b/searx/static/img/favicon.svg @@ -1 +1,17 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/searx/static/img/logo.svg b/searx/static/img/logo.svg index 8b13a027f..a6b98abdb 100644 --- a/searx/static/img/logo.svg +++ b/searx/static/img/logo.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/searx/static/themes/smart/src/scss/mixins.scss b/searx/static/themes/smart/src/scss/mixins.scss index a6647f739..77993c081 100644 --- a/searx/static/themes/smart/src/scss/mixins.scss +++ b/searx/static/themes/smart/src/scss/mixins.scss @@ -108,4 +108,12 @@ $dir: ltr !default; @else { direction: rtl; } +} + +// Fix Color in Dark Mode +@mixin fix-color() { + @media (prefers-color-scheme: dark) { + mix-blend-mode: luminosity; + filter: invert(1); + } } \ No newline at end of file diff --git a/searx/static/themes/smart/src/scss/style.scss b/searx/static/themes/smart/src/scss/style.scss index 5ff7c33b7..5274883c7 100644 --- a/searx/static/themes/smart/src/scss/style.scss +++ b/searx/static/themes/smart/src/scss/style.scss @@ -172,6 +172,8 @@ main:has(.not-found) { font-size: 2rem; display: block; text-align: center; + // TODO: when dark mode colors added + // @include mixin.fix-color(); img { max-width: clamp(70px, 25vw, 150px); @@ -616,6 +618,8 @@ footer { align-items: center; justify-content: center; width: 100px; + // TODO: when dark mode colors added + // @include mixin.fix-color(); img { width: 100%; diff --git a/searx/templates/smart/base.html b/searx/templates/smart/base.html index a967fa481..a9c31db09 100644 --- a/searx/templates/smart/base.html +++ b/searx/templates/smart/base.html @@ -46,15 +46,42 @@ href="{{ opensearch_url }}" /> {% endblock %} - - {# + + - #} - + + + + + + + +
diff --git a/searx/templates/smart/results.html b/searx/templates/smart/results.html index 9f67e1da0..05539c0b3 100644 --- a/searx/templates/smart/results.html +++ b/searx/templates/smart/results.html @@ -1,5 +1,6 @@ {% from 'smart/icons.html' import icon_small %} {% extends "smart/base.html" %} -{% block body %} {% include 'smart/madules/search_header.html' %} +{% block title %}{% if query_in_title %} - {{ q|e }}{% endif %}{% endblock %} {% +block body %} {% include 'smart/madules/search_header.html' %}