mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[feat] add favicons to result urls
This commit is contained in:
committed by
Markus Heiser
parent
3e747d0491
commit
e17d7632d0
@@ -21,9 +21,29 @@
|
||||
{% macro result_header(result, favicons, image_proxify) -%}
|
||||
<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}">
|
||||
{{- result_open_link(result.url, "url_wrapper") -}}
|
||||
{% if not rtl %}
|
||||
{%- if favicon_resolver != "" %}
|
||||
<div class="favicon">
|
||||
<img
|
||||
alt="{{ result.parsed_url.netloc }}"
|
||||
src="{{ favicon_proxify(result.parsed_url.netloc) }}"
|
||||
>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- for part in get_pretty_url(result.parsed_url) -%}
|
||||
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
|
||||
{%- endfor %}
|
||||
{% if rtl %}
|
||||
{%- if favicon_resolver != "" %}
|
||||
<div class="favicon">
|
||||
<img
|
||||
alt="{{ result.parsed_url.netloc }}"
|
||||
src="{{ favicon_proxify(result.parsed_url.netloc) }}"
|
||||
>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{{- result_close_link() -}}
|
||||
{%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" loading="lazy">{{ result_close_link() }}{% endif -%}
|
||||
<h3>{{ result_link(result.url, result.title|safe) }}</h3>
|
||||
|
||||
@@ -173,6 +173,9 @@
|
||||
{%- if 'autocomplete' not in locked_preferences -%}
|
||||
{%- include 'simple/preferences/autocomplete.html' -%}
|
||||
{%- endif -%}
|
||||
{%- if 'favicon' not in locked_preferences -%}
|
||||
{%- include 'simple/preferences/favicon.html' -%}
|
||||
{%- endif -%}
|
||||
{% if 'safesearch' not in locked_preferences %}
|
||||
{%- include 'simple/preferences/safesearch.html' -%}
|
||||
{%- endif -%}
|
||||
|
||||
17
searx/templates/simple/preferences/favicon.html
Normal file
17
searx/templates/simple/preferences/favicon.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<fieldset>{{- '' -}}
|
||||
<legend id="pref_favicon_resolver">{{- _('Favicon Resolver') -}}</legend>{{- '' -}}
|
||||
<div class="value">{{- '' -}}
|
||||
<select name="favicon_resolver" aria-labelledby="pref_favicon_resolver">{{- '' -}}
|
||||
<option value=""> - </option>
|
||||
{%- for backend in favicon_backends -%}
|
||||
<option value="{{ backend }}"
|
||||
{%- if backend == favicon_resolver %} selected="selected" {%- endif -%}>
|
||||
{{- backend -}}
|
||||
</option>
|
||||
{%- endfor -%}
|
||||
</select>{{- '' -}}
|
||||
</div>{{- '' -}}
|
||||
<div class="description">
|
||||
{{- _('Display favicons near search results') -}}
|
||||
</div>{{- '' -}}
|
||||
</fieldset>{{- '' -}}
|
||||
Reference in New Issue
Block a user