75 lines
3.4 KiB
HTML
75 lines
3.4 KiB
HTML
|
<nav class="navbar navbar-expand-lg" style="background-color: {{ config.extra.primary_color }};">
|
||
|
<div class="container-xxl">
|
||
|
<a class="navbar-brand" href="/">
|
||
|
<!-- Use heigher resize_height for better resolution -->
|
||
|
{% set resize_height = 85 %}
|
||
|
{% set logo_meta = get_image_metadata(path=config.extra.logo_path) %}
|
||
|
{% set logo_width_to_height_ratio = logo_meta.width / logo_meta.height %}
|
||
|
{% set resize_width = logo_width_to_height_ratio * resize_height | int %}
|
||
|
{% set image = resize_image(path=config.extra.logo_path, width=resize_width, height=resize_height, op="fill") %}
|
||
|
<img
|
||
|
src="{{ image.url }}"
|
||
|
alt="Home"
|
||
|
{% set actual_height = 70 %}
|
||
|
{% set actual_width = logo_width_to_height_ratio * actual_height | int %}
|
||
|
width="{{ actual_width }}"
|
||
|
height="{{ actual_height }}"
|
||
|
/>
|
||
|
</a>
|
||
|
|
||
|
<button
|
||
|
class="navbar-toggler"
|
||
|
type="button"
|
||
|
data-bs-toggle="collapse"
|
||
|
data-bs-target="#navbarNav"
|
||
|
aria-controls="navbarNav"
|
||
|
aria-expanded="false"
|
||
|
aria-label="Toggle navigation"
|
||
|
>
|
||
|
<span class="navbar-toggler-icon"></span>
|
||
|
</button>
|
||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||
|
<ul class="navbar-nav">
|
||
|
{% for menu_item in config.extra.menu_items %}
|
||
|
{% if menu_item.url %}
|
||
|
<!-- Single item, not a category -->
|
||
|
<li class="nav-item">
|
||
|
<a
|
||
|
class="nav-link"
|
||
|
href="{{ menu_item.url }}"
|
||
|
>
|
||
|
<font color="{{ config.extra.secondary_color }}">
|
||
|
{{ menu_item.name }}
|
||
|
</font>
|
||
|
</a>
|
||
|
</li>
|
||
|
{% else %}
|
||
|
<!-- Category with multiple subitems -->
|
||
|
<li class="nav-item dropdown">
|
||
|
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||
|
<font color="{{ config.extra.secondary_color }}">
|
||
|
{{ menu_item.name }}
|
||
|
</font>
|
||
|
</a>
|
||
|
<ul class="dropdown-menu">
|
||
|
{% for link in menu_item.links %}
|
||
|
<li>
|
||
|
<a
|
||
|
class="dropdown-item"
|
||
|
href="{{ link.url }}"
|
||
|
>
|
||
|
<font color="{{ config.extra.secondary_color }}">
|
||
|
{{ link.name }}
|
||
|
</font>
|
||
|
</a>
|
||
|
</li>
|
||
|
{% endfor %}
|
||
|
</ul>
|
||
|
</li>
|
||
|
{% endif %}
|
||
|
{% endfor %}
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
</nav>
|