diff options
author | tosi29 <tosi16@gmail.com> | 2019-06-08 19:21:34 +0300 |
---|---|---|
committer | tosi29 <tosi16@gmail.com> | 2019-06-08 19:21:34 +0300 |
commit | c493b61850b2b74a822dea64c3b70e02adcdcd8c (patch) | |
tree | b1abd628600afeaf115124575310c5b3d7ebffb8 | |
parent | c6cb6ece2001349c41145ae1eb16fbab318d3f88 (diff) |
Fix url matching in nav
-rw-r--r-- | layouts/partials/header.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index eba930c..881627a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -12,7 +12,7 @@ {{- $currentNode := . }} {{- range sort .Site.Menus.main }} {{- if .Name}} - <li class="menu-item {{if eq $currentNode.Params.url .URL }} current-menu-item current_page_item {{end}}"><a class="menu__link" href="{{ .URL }}">{{ .Name | upper }}</a></li> + <li class="menu-item {{if eq ($.Permalink|absURL) (.URL|absURL) }} current-menu-item current_page_item {{end}}"><a class="menu__link" href="{{ .URL }}">{{ .Name | upper }}</a></li> {{- end }} {{- end }} </ul> @@ -20,7 +20,7 @@ {{- $currentNode := . }} {{- range sort .Site.Menus.main }} {{- if .Name}} - <option value="{{ .URL }}" class="menu-item menu-item-type-custom menu-item-object-custom" {{if eq $currentNode.Params.url .URL }} selected="selected" {{end}}>{{ .Name | upper }}</option> + <option value="{{ .URL }}" class="menu-item menu-item-type-custom menu-item-object-custom" {{if eq ($.Permalink|absURL) (.URL|absURL) }} selected="selected" {{end}}>{{ .Name | upper }}</option> {{- end }} {{- end }} </select> |