{# Shared template macros. Import at the top of any template that needs them: {% from "_macros.html" import icon, brand, mark %} #} {# An icon from the inlined sprite. `name` omits the "i-" prefix. #} {% macro icon(name, cls="") -%} {%- endmacro %} {# The leaf-and-wafer mark, inlined rather than referenced as so it can scale with the surrounding font size. Gradient ids are suffixed with `uid` because ids are document-global: two marks on one page with the same ids means the second silently reuses the first one's gradients. #} {% macro mark(cls="brand-mark", uid="a") -%} {%- endmacro %} {# The wordmark as live text rather than the outlined SVG: it stays selectable, searchable and readable to a screen reader, and scales with the user's font size. The capitals spelling LLM take the leaf accent. #} {% macro wordmark() -%} LLeMbas {%- endmacro %} {# A model's avatar: the uploaded image, or a generated initial. The fallback colour is derived from the model id, so every model gets a stable, distinct-looking badge without an administrator having to upload anything. Hue only -- saturation and lightness are fixed so the result always sits legibly against both themes. #} {% macro model_avatar(model, cls="model-avatar") -%} {% if model.image_path %} {% else %} {% endif %} {%- endmacro %} {% macro brand(href="/", uid="a") -%} {{ mark(uid=uid) }} {{ wordmark() }} {%- endmacro %}