mirror of https://github.com/Hilbis/Hilbish
fix(website): block out link and highlight current page in nav bar
parent
2e0eabbac7
commit
a6aa58f8fb
|
@ -7,17 +7,17 @@ theme = 'hsh'
|
||||||
[[menu.nav]]
|
[[menu.nav]]
|
||||||
identifier = 'home'
|
identifier = 'home'
|
||||||
name = 'Home'
|
name = 'Home'
|
||||||
url = '/'
|
pageref = '/'
|
||||||
weight = 1
|
weight = 1
|
||||||
[[menu.nav]]
|
[[menu.nav]]
|
||||||
identifier = 'install'
|
identifier = 'install'
|
||||||
name = 'Install'
|
name = 'Install'
|
||||||
url = '/install'
|
pageref = '/install/'
|
||||||
weight = 2
|
weight = 2
|
||||||
[[menu.nav]]
|
[[menu.nav]]
|
||||||
identifier = 'docs'
|
identifier = 'docs'
|
||||||
name = 'Docs'
|
name = 'Docs'
|
||||||
url = '/docs'
|
pageref = '/docs/'
|
||||||
weight = 3
|
weight = 3
|
||||||
|
|
||||||
[markup.goldmark.renderer]
|
[markup.goldmark.renderer]
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-md sticky-top bg-light">
|
<nav class="navbar navbar-expand-md sticky-top bg-light">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="#">
|
<a class="navbar-brand" href="/Hilbish">
|
||||||
<img src="/Hilbish/hilbish-flower.png" alt="" height="24" class="d-inline-block align-text-top">
|
<img src="/Hilbish/hilbish-flower.png" alt="" height="24" class="d-inline-block align-text-top">
|
||||||
Hilbish
|
Hilbish
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.nav }}
|
{{ range .Site.Menus.nav }}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="{{ .URL }}" class="nav-link {{ if $currentPage.HasMenuCurrent "nav" . }}active{{ end }}">
|
<a {{ if not ($currentPage.IsMenuCurrent "nav" .) }}href="{{ .URL }}"{{ end }} class="nav-link {{ if $currentPage.IsMenuCurrent "nav" . }}active{{ end }}">
|
||||||
{{ .Name }}
|
{{ .Name }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
Loading…
Reference in New Issue