durfdoen-2.0/layouts/partials/navbar.erb
2020-09-16 20:46:00 +02:00

40 lines
1.3 KiB
Text

<nav class="navbar">
<ul class="navbar-nav">
<li class="nav-item nav-link__logo__wrapper">
<a href="/" class="nav-link nav-link__logo">
<img src="/assets/durfDoenClean.png" alt="" class="logo__image">
</a>
</li>
<% for i in navigables %>
<li class="nav-item">
<a href="<%= i.path %>" class="nav-link">
<%= @items["/assets/navbar_icons/"+i.identifier.without_ext[1..]+".svg"].compiled_content %>
<span class="link-text"><%= i[:naam] %> </span>
</a>
</li>
<% end %>
<li class="nav-item">
<div class="nav-link">
<a href="/search.html"><%= @items["/assets/navbar_icons/search.svg"].compiled_content %></a>
<form class="link-text" action="/search.html">
<input type="search" name="q" placeholder="Zoek…">
</form>
</a>
</li>
</ul>
</nav>
<script>
// const nav_links = document.querySelectorAll(".nav-link");
// nav_links.forEach(nav_link => {
// if (nav_link.getAttribute("href") === "/") {
// if (window.location.pathname === "/") {
// nav_link.classList.add("active_link");
// }
// } else if (window.location.pathname.startsWith(nav_link.getAttribute("href"))) {
// nav_link.classList.add("active_link");
// }
// })
</script>