SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[feat] results: show source of suggested answer
Bnyro13d801b75d01
diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.lessindex 366b4d580..ccfc221a2 100644--- a/searx/static/themes/simple/src/less/style.less+++ b/searx/static/themes/simple/src/less/style.less@@ -633,6 +633,18 @@ summary.title {span {overflow-wrap: anywhere;}++ .answer {+ display: flex;+ flex-direction: column;+ }++ .answer-url {+ margin-left: auto;+ margin-top: 5px;+ margin-right: 10px;+ margin-bottom: 10px;+ }}#infoboxes {diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.htmlindex c472d585c..42ad3fa3d 100644--- a/searx/templates/simple/results.html+++ b/searx/templates/simple/results.html@@ -23,11 +23,10 @@<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>{%- for answer in answers.values() -%}<div class="answer">- {% if answer.url %}- <a href="{{ answer.url }}">{{ answer.answer }}</a>- {% else %}- <span>{{ answer.answer }}</span>- {% endif %}+ <span>{{ answer.answer }}</span>+ {% if answer.url -%}+ <a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>+ {% endif -%}</div>{%- endfor -%}</div>diff --git a/searx/webapp.py b/searx/webapp.pyindex 59c1dd1a1..9793ee534 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -22,7 +22,7 @@ from typing import List, Dict, Iterableimport urllibimport urllib.parse-from urllib.parse import urlencode, unquote+from urllib.parse import urlencode, urlparse, unquoteimport httpx@@ -444,6 +444,7 @@ def render(template_name: str, **kwargs):}))+ kwargs['urlparse'] = urlparse# scripts from pluginskwargs['scripts'] = set()