{{ $currentPage := .currentPage }} {{ $menuName := .menuName }} {{ $class := slice }} {{ with .context.Page }} {{ if ne .RelPermalink "/" }} {{ $class = $class | append (path.Base .RelPermalink) }} {{ end }} {{ end }} {{ if $currentPage.IsMenuCurrent $menuName .context }} {{ $class = $class | append "active" }} {{ end }}