diff --git a/_includes/nav.html b/_includes/nav.html index a0d26b8..c2bdf66 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -7,33 +7,31 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </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> - {% else %} + {%- else -%} <a class="navbar-brand" href="{{ '' | absolute_url }}">{{ site.title }}</a> - {% endif %} + {%- endif -%} </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 %} + {%- 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 %} - {% include navbarlink.html link=linkparts %} - {% endfor %} - {% endfor %} + {%- for childlink in link[1] -%} + {%- for linkparts in childlink %} + <a href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a> + {%- endfor -%} + {%- endfor %} </div> </li> {% else %} - <li> - {% include navbarlink.html link=link %} - </li> - {% endif %} - {% endfor %} + <li><a href="{{ link[1] | relative_url }}">{{ link[0] }}</a></li> + {%- endif -%} + {%- endfor -%} </ul> </div> diff --git a/_includes/navbarlink.html b/_includes/navbarlink.html deleted file mode 100644 index d8005e6..0000000 --- a/_includes/navbarlink.html +++ /dev/null @@ -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>