_includes/nav-sub.html in kcc-gem-theme-3.7.3 vs _includes/nav-sub.html in kcc-gem-theme-3.7.4

- old
+ new

@@ -5,11 +5,17 @@ <a class="navbar-brand" href="{% if page.sub-nav_section_link == false %}#{% else %}{{ page.baseurl }}{{ page.sub-nav_section | downcase }}{% endif %}"><h2 class="typography__sub-nav--red-h2 mb-0">{{ page.sub-nav_section | capitalize | replace: "-", " " }}</h2></a> <ul id="subNavNav" class="nav ml-auto"> {% assign section = page.sub-nav_section | downcase | append: "/" %} {% for nav in site.sub-nav_links %} {% if nav.link_href contains section %} + {% assign last_char = nav.link_href | slice: -1, 1 %} + {% if last_char == '/' or nav.link_href contains '#contact' %} + {% assign link = nav.link_href %} + {% else %} + {% assign link = nav.link_href | append: '/' %} + {% endif %} <li class="nav-item js-sub-nav-item"> - <a href="{{ page.baseurl }}{{ nav.link_href }}" class="nav-link sub-nav__nav-link">{{ nav.link_text }}</a> + <a href="{{ page.baseurl }}{{ link }}" class="nav-link sub-nav__nav-link">{{ nav.link_text }}</a> </li> {% endif %} {% endfor %} </ul> </nav>