{#- Template file for the header. -#} {%- set hamburger -%} {%- endset -%} {%- macro home_link(logo=false) -%} {%- if logo -%} Logo {%- endif -%} {%- endmacro -%} {%- macro extra_link(text, url) -%} {% if url is string %} {% set url = url if url.startswith("http") else pathto(url) %} {%- set active = "bg-gray-700 border-b-4 border-brand" if pagename in url else "bg-transparent" -%} {{ text }} {% endif %} {% if url is mapping %} {% set link = url.link if url.link.startswith("http") else pathto(url.link) %} {{ url.icon }} {% endif %} {%- endmacro -%}
{#- show logo on the left side of the header -#}
{%- if theme_show_nav|tobool %} {{ hamburger }} {%- endif %} {%- block logo -%} {{ home_link(logo) }} {%- endblock -%}
{#- show a search input field on the right side -#}
{%- include "searchbox.html" %} {%- if theme_extra_header_links|tobool -%} {%- block extra_header_links -%}
{%- for text, url in theme_extra_header_links.items() -%} {{ extra_link(text, url) }} {%- endfor -%}
{%- endblock -%} {%- endif -%}