_includes/header.html in langara-department-jekyll-theme-0.1.0 vs _includes/header.html in langara-department-jekyll-theme-0.2.0

- old
+ new

@@ -7,22 +7,34 @@ <!-- INSTRUCTOR SPACE BADGE --> <span class="badge badge-primary instructor-badge">For Instructors <br>and Students<br><p class="instructor-badge-highlight"> Only</p></span> <!-- MAIN NAVIGATION START --> <nav class="navbar navbar-expand-lg navbar-light bg-transparent py-4"> - <a class="navbar-brand" href="index.html"> + <a class="navbar-brand" href="{{ "/index.html" | relative_url }}"> <img src="https://cdn.langara.ca/prod/dept/csis/assets/img/langara-csis-logo.png" width="335" class="d-inline-block align-top" alt="Langara: The college of higher learning. Computer Science and Information Systems"> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="justify-content-end collapse navbar-collapse" id="navbarNavAltMarkup"> <div class="navbar-nav"> - <a class="nav-item nav-link active px-3 nav-links" href="/index.html">Resources<span class="sr-only">(current)</span></a> - <a class="nav-item nav-link px-3 nav-links" href="news-events/index.html">News/Events </a> - <a class="nav-item nav-link px-3 nav-links" href="faq.html">How to &amp; FAQ's </a> + {%- assign default_paths = site.pages | map: "path" -%} + {%- assign page_paths = site.header_pages | default: default_paths -%} + {%- assign titles_size = site.pages | map: 'title' | join: '' | size -%} + {%- for path in page_paths -%} + {%- assign my_page = site.pages | where: "path", path | first -%} + {%- if my_page.url == page.url -%} + {%- assign activeclass = "active" -%} + {%- else -%} + {%- assign activeclass = "" -%} + {%- endif -%} + + {%- if my_page.title -%} + <a class="nav-item nav-link px-3 nav-links {{activeclass}}" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a> + {%- endif -%} + {%- endfor -%} <a class="nav-item px-3 pt-4" href="#"><i class="fas fa-search icon-style"></i></a> </div> </div> </nav><!-- MAIN NAVIGATION START --> </div>