matrix.org/templates/includes/header.html

40 lines
1.8 KiB
HTML

<header class="site-header">
<a href="/" class="brand">
<img src="/images/matrix-logo-white.svg" alt="Matrix logo">
</a>
<input id="site-header-dropdown-checkbox" type="checkbox" class="dropdown-checkbox" aria-hidden="true">
<label for="site-header-dropdown-checkbox" class="dropdown-button">&#xe602;</label>
<label for="site-header-dropdown-checkbox" class="page-overlay"></label>
<nav>
{% for link in navigation.header %}
{% if link.section %}
{% set href = "/" ~ link.section ~ "/" %}
{% set section = get_section(path=link.section ~ "/_index.md") %}
<div class="section-wrap">
<input id="{{ link.section }}-submenu-checkbox" type="checkbox" class="submenu-checkbox" aria-hidden="true"
{{ util::current_checked(if_path_starts_with="/" ~ link.section) }}>
<label for="{{ link.section }}-submenu-checkbox" class="submenu-title">{{ link.title }} <div class="arrow">
</div></label>
<div class="section-submenu-wrap">
<div class="section-submenu">
{% for subsection_path in section.subsections %}
{% set subsection = get_section(path=subsection_path) %}
<a href="{{ subsection.path }}">{{ subsection.title }}</a>
{% endfor %}
{% for page in section.pages %}
<a href="{{ page.path }}">{{ page.title }}</a>
{% endfor %}
</div>
</div>
</div>
{% else %}
<a href="{{ link.href }}" class="{% if link.primary %}primary{% endif %}
{{ util::current_class(if_path_starts_with=link.href) }}">
{{ link.title }}
</a>
{% endif %}
{% endfor %}
</nav>
</header>