searxng-beetroot/beetroot_template/macros.html
2024-03-06 00:19:57 +01:00

3.3 KiB
Raw Blame History

{% from 'beetroot/icons.html' import icon_small %} {% macro draw_favicon(favicon) -%} {{ favicon }} {%- endmacro %} {% macro result_open_link(url, classes='') -%} {%- endmacro %} {%- macro result_close_link() -%} {%- endmacro %} {%- macro result_link(url, title, classes='') -%} {{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }} {%- endmacro -%} {% macro result_header(result, favicons, image_proxify) -%}
{{- result_open_link(result.url, "url_wrapper") -}} {%- for part in get_pretty_url(result.parsed_url) -%} {{- part -}} {%- endfor %} {{- result_close_link() -}} {%- if result.img_src %}{{ result_open_link(result.url) }}{{ result_close_link() }}{% endif -%} {%- if result.thumbnail %}{{ result_open_link(result.url) }}{{ result_close_link() }}{% endif -%}

{{ result_link(result.url, result.title|safe) }}

{%- endmacro -%} {%- macro result_sub_header(result) -%} {%- if result.publishedDate %}{% endif -%} {%- if result.length %}
{{ _('Length') }}: {{ result.length }}
{% endif -%} {%- if result.author %}
{{ _('Author') }}: {{ result.author }}
{% endif -%} {%- if result.metadata %}
{{ result.metadata|safe }}
{% endif -%} {%- endmacro -%} {%- macro result_sub_footer(result, proxify) -%}
{% for engine in result.engines %}{{ engine }}{% endfor %} {{ icon_small('ellipsis-vertical-outline') + result_link(cache_url + result.url, _('cached'), "cache_link") }} {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %}
{{- '' -}}
{{- '' -}} {%- endmacro -%} {%- macro result_footer(result) -%}
{%- endmacro -%} {%- macro checkbox_onoff(name, checked) -%} {%- endmacro -%}