{% from 'simple/icons.html' import icon_small %}
{% macro draw_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_badges(result) -%}
{%- set _netloc = (result.parsed_url.netloc if result.parsed_url else '') | lower -%}
{%- set _path = (result.parsed_url.path if result.parsed_url else '') | lower -%}
{%- if 'github.com' in _netloc -%}GitHub{% endif -%}
{%- if 'youtube.com' in _netloc or 'youtu.be' in _netloc or result.category == 'videos' -%}Video{% endif -%}
{%- if result.category == 'news' -%}News{% endif -%}
{%- if result.category == 'science' or 'arxiv.org' in _netloc or 'pubmed' in _netloc or 'acm.org' in _netloc -%}Research{% endif -%}
{%- if result.url and result.url.lower().endswith('.pdf') -%}PDF{% endif -%}
{%- if _netloc.startswith('blog.') or 'medium.com' in _netloc or 'substack.com' in _netloc or 'wordpress.com' in _netloc -%}Blog{% endif -%}
{%- if _netloc.startswith('docs.') or _netloc.startswith('developer.') or 'readthedocs' in _netloc or '/docs' in _path or '/documentation' in _path -%}Documentation{% endif -%}
{%- endmacro -%}
{% macro result_source_line(result) -%}