1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[mod] favicons: simplify RTL in template & CSS

Comes from a sughgestion in:

- https://github.com/searxng/searxng/pull/3727#issuecomment-2388998803

Suggested-by: Bnyro <bnyro@tutanota.com>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-10-02 18:06:29 +02:00 committed by Markus Heiser
parent a7d02d4101
commit a631f77401
4 changed files with 17 additions and 21 deletions

View File

@ -82,8 +82,4 @@
transform: scale(1, 1); transform: scale(1, 1);
} }
.favicon {
margin: 0 8px 0 0;
}
@import "style.less"; @import "style.less";

View File

@ -94,12 +94,12 @@
direction: initial; direction: initial;
text-align: right; text-align: right;
.result .url_header {
direction: rtl;
}
.result .url_wrapper { .result .url_wrapper {
justify-content: end; justify-content: end;
.favicon {
margin: 0 0 0 8px;
}
} }
} }

View File

@ -232,6 +232,11 @@ article[data-vim-selected].category-social {
} }
} }
.url_header {
display: flex;
gap: 0.5rem;
}
.url_wrapper { .url_wrapper {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -20,20 +20,15 @@
<!-- Draw result header --> <!-- Draw result header -->
{% macro result_header(result, favicons, image_proxify) -%} {% 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 %}"> <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") -}} {{- result_open_link(result.url, "url_header") -}}
{% if not rtl %}
{%- if favicon_resolver != "" %} {%- if favicon_resolver != "" %}
<div class="favicon"><img loading="lazy" src="{{ favicon_url(result.parsed_url.netloc) }}"></div> <div class="favicon"><img loading="lazy" src="{{ favicon_url(result.parsed_url.netloc) }}"></div>
{%- endif -%} {%- endif -%}
{%- endif -%} <div class="url_wrapper">
{%- for part in get_pretty_url(result.parsed_url) -%} {%- for part in get_pretty_url(result.parsed_url) -%}
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span> <span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
{%- endfor %} {%- endfor %}
{% if rtl %} </div>
{%- if favicon_resolver != "" %}
<div class="favicon"><img loading="lazy" src="{{ favicon_url(result.parsed_url.netloc) }}"></div>
{%- endif -%}
{%- endif -%}
{{- result_close_link() -}} {{- 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 -%} {%- 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> <h3>{{ result_link(result.url, result.title|safe) }}</h3>