{% set _hdr_cfg = config.theme.void.header if (config.theme.void is mapping and config.theme.void.header is mapping) else {} %} {#Page-level front-matter override — whole-header hide is applied by base.html; keep the flag consistent if this partial is included standalone. #} {% set _pg_header_hide = _pg_header_hide if (_pg_header_hide is defined) else ((page.meta.void is mapping and page.meta.void.header is mapping and page.meta.void.header.show == false) if (page and page.meta and page.meta.void is mapping) else false) %} {% set _hdr_position = _hdr_cfg.position if (_hdr_cfg.position is defined) else "sticky" %} {% set _hdr_height = _hdr_cfg.height if (_hdr_cfg.height is defined) else "56px" %} {% set _hdr_z_index = _hdr_cfg.z_index if (_hdr_cfg.z_index is defined) else none %} {% set _hdr_brand_cfg = _hdr_cfg.get("brand") if (_hdr_cfg.get("brand") is mapping) else {} %} {% set _hdr_left_cfg = _hdr_cfg.get("left") if (_hdr_cfg.get("left") is mapping) else {} %} {% set _hdr_logo_size = _hdr_brand_cfg.logo_height if (_hdr_brand_cfg.logo_height is defined) else 26 %} {% set _hdr_right_defaults = [{"type": "palette_toggle"}, {"type": "search"}, {"type": "repo_link"}] %} {% set _hdr_right = _hdr_cfg.right if (_hdr_cfg.right is defined) else _hdr_right_defaults %} {% set _hdr_style = namespace(parts=[]) %} {% if _hdr_position != "sticky" %} {% set _hdr_style.parts = _hdr_style.parts + ["--void-header-position: " ~ _hdr_position] %} {% endif %} {% if _hdr_height != "56px" %} {% set _hdr_style.parts = _hdr_style.parts + ["--void-header-height: " ~ _hdr_height] %} {% endif %} {% if _hdr_z_index is not none %} {% set _hdr_style.parts = _hdr_style.parts + ["--void-header-z: " ~ _hdr_z_index] %} {% endif %} {% macro void_header_icon(icon) %} {% set _icon_svg = ' {% elif icon == "gitlab" %} {{ _icon_svg | safe }} {% elif icon == "external" %} {{ _icon_svg | safe }} {% elif icon == "code" %} {{ _icon_svg | safe }} {% elif icon == "star" %} {{ _icon_svg | safe }} {% else %} {{ _icon_svg | safe }} {% endif %} {% endmacro %}
{% if page.title and (_hdr_left_cfg.show_page_title | default(true)) and (_comp.header.show_page_title | default(true)) %} {{ page.title }} {% endif %} {% if _hdr_left_cfg.show_hamburger | default(true) %} {% endif %}
{% if _hdr_brand_cfg.show | default(true) %} {% set _brand = config.site_name | replace(" Documentation", "") | replace(" Docs", "") %} {% set _logo_dark = config.extra.void_logo_dark | default(config.extra.void_logo_url | default(config.theme.logo, true), true) %} {% set _logo_light = config.extra.void_logo_light | default(config.extra.void_logo_url | default(config.theme.logo, true), true) %} {% set _two_tone = (_logo_dark | string) != (_logo_light | string) and _logo_light %} {% set _site_name = (_brand ~ (_hdr_brand_cfg.site_name_suffix | default(""))) if ((_comp.header.show_site_name | default(true)) and (_hdr_brand_cfg.show_site_name | default(true))) else '' %} {% if _logo_dark and (_comp.header.show_logo | default(true)) %} {% if _logo_dark.startswith("http") %} {% else %} {% endif %} {% endif %} {% if _two_tone and (_comp.header.show_logo | default(true)) %} {% if _logo_light.startswith("http") %} {% else %} {% endif %} {% endif %} {{ _site_name }} {% if config.extra and config.extra.void_site_tagline %} {{ config.extra.void_site_tagline }} {% endif %} {% if config.extra and config.extra.void_site_badge %} {{ config.extra.void_site_badge }} {% endif %} {% endif %}
{% for _item in _hdr_right %} {% set _item_type = _item.type if _item is mapping else _item | string %} {% if _item_type == "palette_toggle" and (_comp.header.show_palette_toggle | default(true)) %} {% include "partials/palette.html" %} {% elif _item_type == "search" and "search" in config.plugins and (_comp.header.show_search | default(true)) %} {% elif _item_type == "repo_link" and config.repo_url and (_comp.header.show_repo_link | default(true)) %} {% set _repo_clean = config.repo_url | replace("https://", "") | replace("http://", "") | replace("git@", "") | replace("ssh://", "") | replace(".git", "") %} {% set _repo_host = _repo_clean.split("/")[0] if "/" in _repo_clean else _repo_clean %} {% set _repo_parts = _repo_clean.split("/") %} {% set _repo_owner = _repo_parts[1] if _repo_parts | length > 1 else "" %} {% set _repo_name = _repo_parts[2] if _repo_parts | length > 2 else "" %} {% if "github" in _repo_host %} {% elif "gitlab" in _repo_host %} {% elif "bitbucket" in _repo_host %} {% elif "gitea" in _repo_host %} {% elif "codeberg" in _repo_host %} {% else %} {% endif %} {{ _repo_host | capitalize }} {% elif _item_type == "link" or _item_type == "button" %} {% set _item_label = (_item.label | default("")) | string %} {% set _item_url = _item.url | default("#", true) | string %} {% set _item_class = "void-header__item" %} {% if _item_type == "button" %} {% set _item_style = _item.style | default("primary") | string %} {% set _item_class = _item_class ~ " void-header__item--" ~ _item_style %} {% endif %} {% if not _item_label %} {% set _item_class = _item_class ~ " void-header__item--icon" %} {% endif %} {% if _item.icon is defined and _item.icon %}{{ void_header_icon(_item.icon | string) }}{% endif %} {% if _item_label %}{{ _item_label }}{% endif %} {% endif %} {% endfor %}