Obsoletes navbarlink with relative_url filter (#508)
This commit is contained in:
parent
8edf9a0794
commit
db9bbfe546
@ -7,33 +7,31 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
{% if site.title-img %}
|
{%- if site.title-img -%}
|
||||||
<a class="navbar-brand navbar-brand-logo" href="{{ '' | absolute_url }}"><img src="{{ site.title-img }}"/></a>
|
<a class="navbar-brand navbar-brand-logo" href="{{ '' | absolute_url }}"><img src="{{ site.title-img }}"/></a>
|
||||||
{% else %}
|
{%- else -%}
|
||||||
<a class="navbar-brand" href="{{ '' | absolute_url }}">{{ site.title }}</a>
|
<a class="navbar-brand" href="{{ '' | absolute_url }}">{{ site.title }}</a>
|
||||||
{% endif %}
|
{%- endif -%}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="main-navbar">
|
<div class="collapse navbar-collapse" id="main-navbar">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
{% for link in site.navbar-links %}
|
{%- for link in site.navbar-links -%}
|
||||||
{% if link[1].first %}
|
{%- if link[1].first %}
|
||||||
<li class="navlinks-container">
|
<li class="navlinks-container">
|
||||||
<a class="navlinks-parent" href="javascript:void(0)">{{ link[0] }}</a>
|
<a class="navlinks-parent" href="javascript:void(0)">{{ link[0] }}</a>
|
||||||
<div class="navlinks-children">
|
<div class="navlinks-children">
|
||||||
{% for childlink in link[1] %}
|
{%- for childlink in link[1] -%}
|
||||||
{% for linkparts in childlink %}
|
{%- for linkparts in childlink %}
|
||||||
{% include navbarlink.html link=linkparts %}
|
<a href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
|
||||||
{% endfor %}
|
{%- endfor -%}
|
||||||
{% endfor %}
|
{%- endfor %}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>
|
<li><a href="{{ link[1] | relative_url }}">{{ link[0] }}</a></li>
|
||||||
{% include navbarlink.html link=link %}
|
{%- endif -%}
|
||||||
</li>
|
{%- endfor -%}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
{% capture before %}{{ include.link[1] | split: "://" | first }}{% endcapture %}
|
|
||||||
{% capture after %}{{ include.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 %}{{ include.link[1] | relative_url }}{% endcapture %}
|
|
||||||
{% else %}
|
|
||||||
{% capture linkurl %}{{ include.link[1] }}{% endcapture %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<a href="{{ linkurl }}">{{ include.link[0] }}</a>
|
|
Loading…
Reference in New Issue
Block a user