nav.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <nav class="navbar navbar-expand-xl navbar-light fixed-top navbar-custom {% if page.nav-short %}top-nav-short-permanent{% else %}top-nav-regular{% endif %}">
  2. {%- if site.title-img -%}
  3. <a class="navbar-brand navbar-brand-logo" href="{{ '/' | absolute_url }}"><img alt="{{ site.title }} Logo" src="{{ site.title-img | relative_url}}"/></a>
  4. {%- elsif site.title -%}
  5. <a class="navbar-brand" href="{{ '/' | absolute_url }}">{{ site.title }}</a>
  6. {%- endif -%}
  7. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
  8. <span class="navbar-toggler-icon"></span>
  9. </button>
  10. <div class="collapse navbar-collapse" id="main-navbar">
  11. <ul class="navbar-nav ml-auto">
  12. {%- for link in site.navbar-links -%}
  13. {%- if link[1].first %}
  14. <li class="nav-item dropdown">
  15. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ link[0] }}</a>
  16. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
  17. {%- for childlink in link[1] -%}
  18. {%- for linkparts in childlink %}
  19. <a class="dropdown-item" href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
  20. {%- endfor -%}
  21. {%- endfor %}
  22. </div>
  23. </li>
  24. {% else %}
  25. <li class="nav-item">
  26. <a class="nav-link" href="{{ link[1] | relative_url }}">{{ link[0] }}</a>
  27. </li>
  28. {%- endif -%}
  29. {%- endfor -%}
  30. {% if site.post_search %}
  31. <li class="nav-item">
  32. <a class="nav-link" id="nav-search-link" href="#" title="Search">
  33. <span id="nav-search-icon" class="fa fa-search"></span>
  34. <span id="nav-search-text">Search</span>
  35. </a>
  36. </li>
  37. {%- endif -%}
  38. </ul>
  39. </div>
  40. {% if site.navbar-extra %}
  41. {% for file in site.navbar-extra %}
  42. {% include {{ file }} %}
  43. {% endfor %}
  44. {% endif %}
  45. {% if site.avatar and page.show-avatar != false %}
  46. <div class="avatar-container">
  47. <div class="avatar-img-border">
  48. <a href="{{ '/' | absolute_url }}">
  49. <img alt="Navigation bar avatar" class="avatar-img" src="{{ site.avatar | relative_url }}" />
  50. </a>
  51. </div>
  52. </div>
  53. {% endif %}
  54. </nav>
  55. {% include search.html %}