_navigation.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  2. <div class="container">
  3. <div class="navbar-header">
  4. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  5. <span class="sr-only">Toggle navigation</span>
  6. <span class="icon-bar"></span>
  7. <span class="icon-bar"></span>
  8. <span class="icon-bar"></span>
  9. </button>
  10. <a class="navbar-brand" href="{{ HOME_PATH }}">
  11. <img src="/assets/themes/apache/img/logo.png" width="50">
  12. {{ site.data.project.name }}
  13. <span class="version">{{ site.data.project.version }}</span>
  14. </a>
  15. </div>
  16. <nav class="navbar-collapse collapse" role="navigation">
  17. <ul class="nav navbar-nav navbar-right">
  18. {% for entry in site.data.navigation.topnav %}
  19. <li id="{{ entry.title | slugify }}">
  20. {% if entry.subcategories %}
  21. <a href="#" data-toggle="dropdown" class="dropdown-toggle">{{ entry.title }}<b class="caret"></b></a>
  22. <ul class="dropdown-menu dropdown-left">
  23. {% for subitem in entry.subcategories %}
  24. {% if subitem.url contains "http" %}
  25. {% assign target = "_blank" %}{% else %}
  26. {% assign target = "_self" %}{% endif %}
  27. <li><a href="{{ subitem.url }}" target="{{ target }}">{{ subitem.title }}</a></li>
  28. {% endfor %}
  29. </ul>
  30. {% else %}
  31. {% if entry.url contains "http" %}
  32. {% assign target = "_blank" %}{% else %}
  33. {% assign target = "_self" %}{% endif %}
  34. <a href="{{ entry.url }}" target="{{ target }}">{{ entry.title }}</a>
  35. {% endif %}
  36. </li>
  37. {% endfor %}
  38. </ul>
  39. </nav><!--/.navbar-collapse -->
  40. </div>
  41. </div>