Skip to content

Commit

Permalink
Update header.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnavK-09 authored Feb 4, 2024
1 parent dfdfce3 commit 448dcd2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions themes/hugo-bootstrap/layouts/partials/base/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<ul class="nav navbar-nav ml-auto">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{- $active := strings.Contains $currentPage.RelPermalink .URL }}
<li class="nav-item mr-xl-3 ml-xl-3 mr-lg-2 ml-lg-2 mr-0 ml-0">
<a class="nav-link menu-item" href="{{ .URL | absLangURL }}">
{{ .Pre }}
<span class="text-capitalize no-decoration {{ $.Site.Params.navbarLinkFgColorClass | default $.Site.Data.Defaults.navbarLinkFgColorClass }}">{{ .Name }}</span>
{{ .Pre }}
<span class="text-capitalize no-decoration {{ if $active }}nav_active_link{{ end }} {{ $.Site.Params.navbarLinkFgColorClass | default $.Site.Data.Defaults.navbarLinkFgColorClass }}">{{ .Name }}</span>
</a>
</li>
{{end}}
Expand All @@ -34,3 +35,11 @@
{{ end }}
</div>
</nav>

<style>
.nav_active_link {
text-decoration: underline;
text-underline-offset: 8px;
font-weight: 700;
}
</style>

0 comments on commit 448dcd2

Please sign in to comment.