Skip to content

Commit

Permalink
Add navigation highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
li-kai committed Jul 1, 2017
1 parent 81783a8 commit e5df2f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ <h1 class="banner-text"><a href="/" title="NUS Hackers" rel="home" class="banner
</div>
<nav class="nav col-12 col-sm-8 col-lg-6 offset-lg-2">
<ul class="nav-menu">
{{ $currentPage := . }}
{{ $currentURL := .URL }}
{{ range .Site.Menus.main }}
<li class="nav-menu-item"><a class="nav-menu-link{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} nav-menu-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></li>
<li class="nav-menu-item{{ if in $currentURL .URL}} nav-menu-active{{ end }}"><a class="nav-menu-link" href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</nav>
Expand Down
4 changes: 2 additions & 2 deletions static/scss/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
text-decoration: none;
color: black;
}
.nav-menu-item:hover {
.nav-menu-active, .nav-menu-item:hover {
background: $highlight-orange;
}
.nav-menu-item:hover .nav-menu-link {
.nav-menu-active .nav-menu-link, .nav-menu-item:hover .nav-menu-link {
text-decoration: none;
color: white;
}
Expand Down

0 comments on commit e5df2f0

Please sign in to comment.