2022-05-10 15:52:28 +00:00
|
|
|
{% macro render_header() %}
|
2024-12-08 14:16:03 +00:00
|
|
|
{% set root_section = get_section(path="_index.md") %}
|
|
|
|
{% set active_section = "" %}
|
|
|
|
{% if page and page.components %}
|
|
|
|
{% set active_section = page.components[0] %}
|
|
|
|
{% elif section and section.components %}
|
|
|
|
{% set active_section = section.components[0] %}
|
|
|
|
{% endif %}
|
2022-12-21 23:07:05 +00:00
|
|
|
|
2024-12-08 14:16:03 +00:00
|
|
|
<a href="{{ root_section.permalink }}">
|
2022-05-10 15:52:28 +00:00
|
|
|
<div class="logo">
|
|
|
|
<img src="{{ get_url(path=config.extra.juice_logo_path) }}" alt="logo">
|
|
|
|
{{ config.extra.juice_logo_name }}
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<nav>
|
2022-12-21 23:07:05 +00:00
|
|
|
<ul>
|
2024-12-08 14:16:03 +00:00
|
|
|
{% for subpath in root_section.subsections %}
|
2022-12-21 23:07:05 +00:00
|
|
|
{% set sub = get_section(path=subpath) %}
|
2024-12-08 14:16:03 +00:00
|
|
|
{% set is_active = sub.components[0] == active_section %}
|
2024-12-07 15:12:13 +00:00
|
|
|
{% if not 'hide_from_menu' in sub.extra or not sub.extra.hide_from_menu %}
|
2024-12-08 14:16:03 +00:00
|
|
|
<li>
|
|
|
|
<a class="nav-item text{% if is_active %} active{% endif %}" href="{{ sub.permalink }}">{{ sub.title }}</a>
|
|
|
|
</li>
|
2024-12-07 15:12:13 +00:00
|
|
|
{% endif %}
|
2022-05-10 15:52:28 +00:00
|
|
|
{% endfor %}
|
2022-12-21 23:07:05 +00:00
|
|
|
{% if config.extra.juice_extra_menu %}
|
|
|
|
{% for menu in config.extra.juice_extra_menu %}
|
2024-12-08 14:16:03 +00:00
|
|
|
<li><a class="nav-item text" href="{{ menu.link }}">{{ menu.title }}</a></li>
|
2022-12-21 23:07:05 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
2022-05-10 15:52:28 +00:00
|
|
|
</nav>
|
2022-05-11 15:53:45 +00:00
|
|
|
{% endmacro render_header %}
|