78 lines
2.9 KiB
HTML
78 lines
2.9 KiB
HTML
<nav class="navbar navbar-default navbar-fixed-top navbar-custom">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="{{ site.url }}">{{ site.title }}</a>
|
|
</div>
|
|
|
|
<div class="collapse navbar-collapse" id="main-navbar">
|
|
<ul class="nav navbar-nav navbar-right">
|
|
{% for link in site.navbar-links %}
|
|
{% if link[1].first %}
|
|
<li class="navlinks-container">
|
|
<a class="navlinks-parent" href="javascript:void(0)">{{ link[0] }}</a>
|
|
<div class="navlinks-children">
|
|
{% for childlink in link[1] %}
|
|
{% for linkparts in childlink %}
|
|
{% capture before %}{{ linkparts[1] | split: "://" | first }}{% endcapture %}
|
|
{% capture after %}{{ linkparts[1] | split: "://" | last }}{% endcapture %}
|
|
{% assign internal = true %}
|
|
{% if before != after %}
|
|
{% if before == "http" or before == "https" %}
|
|
{% assign internal = false %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if internal %}
|
|
{% capture linkurl %}{{ site.baseurl }}/{{ linkparts[1] }}{% endcapture %}
|
|
{% else %}
|
|
{% capture linkurl %}{{ linkparts[1] }}{% endcapture %}
|
|
{% endif %}
|
|
|
|
<a href="{{ linkurl }}">{{ linkparts[0] }}</a>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</div>
|
|
</li>
|
|
{% else %}
|
|
<li>
|
|
{% capture before %}{{ link[1] | split: "://" | first }}{% endcapture %}
|
|
{% capture after %}{{ link[1] | split: "://" | last }}{% endcapture %}
|
|
{% assign internal = true %}
|
|
{% if before != after %}
|
|
{% if before == "http" or before == "https" %}
|
|
{% assign internal = false %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if internal %}
|
|
{% capture linkurl %}{{ site.baseurl }}/{{ link[1] }}{% endcapture %}
|
|
{% else %}
|
|
{% capture linkurl %}{{ link[1] }}{% endcapture %}
|
|
{% endif %}
|
|
|
|
<a href="{{ linkurl }}">{{ link[0] }}</a>
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
{% if site.avatar and (layout.show-avatar or page.show-avatar) %}
|
|
<div class="avatar-container">
|
|
<div class="avatar-img-border">
|
|
<a href="{{ site.url }} ">
|
|
<img class="avatar-img" src="{{ site.avatar | prepend: site.baseurl | replace: '//', '/' }}" />
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</nav>
|