Commit 924b3646 authored by Yohan Jarosz's avatar Yohan Jarosz

properly assing index page

parent 9a2c8f66
......@@ -5,25 +5,36 @@
</div>
<br/>
<div class="row">
{% if page.index %}
{% assign brand = page.index | split:"$" %}
{% endif %}
{% if page.type == 'project' or page.type == 'subpage' %}
{% capture prefix %}/web/{{brand[0]}}{% endcapture %}
{% elsif page.type == 'frozen'%}
{% capture prefix %}/frozen/{{brand[0]}}{% endcapture %}
{% endif %}
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
{% if page.index %}
{% assign brand = page.index | split:"$" %}
<a class="navbar-brand" href="{{ site.baseurl }}{{brand[0]}}">{{brand[1]}}</a>
<a class="navbar-brand" href="{{ site.baseurl }}{{prefix}}">{{brand[1]}}</a>
{% endif %}
<ul class="nav navbar-nav">
{% if page.nav %}
{% capture indexurl %}{{brand[0]}}index.html{% endcapture %}
{% capture indexurl %}{{ site.baseurl }}{{prefix}}{% endcapture %}
{% capture indexurl2 %}{{ site.baseurl }}{{prefix}}/index.html{% endcapture %}
{% assign navs = page.nav | split:"," %}
{% for nav in navs %}
{% assign link = nav | split:"$" %}
{% assign myurl = link[0] %}
{% if myurl contains '://' %}
<li class="{% if page.url contains myurl %}active{% endif %}"><a href="{{myurl}}">{{link[1]}}</a></li>
{% elsif myurl == '/index' and page.url == indexurl %}
<li class="active"><a href="{{myurl}}.html">{{link[1]}}</a></li>
<li><a href="{{myurl}}">{{link[1]}}</a></li>
{% elsif myurl == 'index' and (page.url == indexurl or page.url == indexurl2) %}
<li class="active"><a href="{{ site.baseurl }}{{prefix}}/{{myurl}}.html">{{link[1]}}</a></li>
{% else %}
<li class="{% if page.url contains myurl and myurl != '/index' and myurl != 'index' %}active{% endif %}"><a href="{{myurl}}.html">{{link[1]}}</a></li>
<li class="{% if page.url contains myurl and myurl != '/index' and myurl != 'index' %}active{% endif %}"><a href="{{ site.baseurl }}{{prefix}}/{{myurl}}.html">{{link[1]}}</a></li>
{% endif %}
{% endfor %}
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment