support menus in navbar
This commit is contained in:
parent
1d3b3e258c
commit
4fe69971e3
4 changed files with 117 additions and 27 deletions
|
@ -12,26 +12,54 @@
|
|||
|
||||
<div class="collapse navbar-collapse" id="main-navbar">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% for link in site.navbar-links %}
|
||||
{% capture before %}{{ link[1] | split: "://" | first }}{% endcapture %}
|
||||
{% capture after %}{{ link[1] | split: "://" | last }}{% endcapture %}
|
||||
<li>
|
||||
{% 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 %}
|
||||
{% 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 %}
|
||||
{% capture linkurl %}{{ link[1] }}{% endcapture %}
|
||||
{% endif %}
|
||||
<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 %}
|
||||
|
||||
<a href="{{ linkurl }}">{{ link[0] }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue