-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul the nav bar popover button.
- Loading branch information
Showing
3 changed files
with
447 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
{{/* Expects to be passed an array of objects that have `name` and `link` fields */}} | ||
{{/* Expects to be passed the page object. */}} | ||
|
||
|
||
{{ $thisPageLink := .RelPermalink | strings.TrimSuffix "/" }} | ||
{{ $navLinks := .Site.Params.Navbar.links }} | ||
{{/* The standard site nav for full-size screens */}} | ||
<div class="hidden lg:flex bg-base-200"> | ||
<ul class="menu menu-horizontal font-semibold text-accent"> | ||
{{ $thisPageLink := .RelPermalink | strings.TrimSuffix "/" }} | ||
{{ range $navitem := .Site.Params.Navbar.links }}{{ with $navitem}} | ||
{{ if eq $thisPageLink (.link | strings.TrimSuffix "/") }} | ||
<li><a class="active" href="{{ .link }}">{{ .name }}</a></li> | ||
{{ range $navItem := $navLinks }} | ||
{{ if eq $thisPageLink ($navItem.link | strings.TrimSuffix "/") }} | ||
<li><a class="active" href="{{ $navItem.link }}">{{ $navItem.name }}</a></li> | ||
{{ else }} | ||
<li><a href="{{ .link }}">{{ .name }}</a></li> | ||
{{ end }} | ||
<li><a href="{{ $navItem.link }}">{{ $navItem.name }}</a></li> | ||
{{ end }}{{ end }} | ||
</ul> | ||
</div> | ||
{{/* The mobile-only dropdown menu */}} | ||
<div class="lg:hidden dropdown"> | ||
<div tabindex="0" role="button" class="btn btn-accent btn-sm lg:hidden p-0.5 align-middle dark:text-white"> | ||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" /></svg> | ||
</div> | ||
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52"> | ||
{{/* {{ range $navitem := .}} | ||
{{ with $navitem }} | ||
<li><a href="{{ .link }}">{{ .name }}</a></li> | ||
{{ end }} | ||
{{ end }} */}} | ||
</ul> | ||
</div> | ||
<label for="sidebar-drawer" class="lg:hidden drawer-button btn btn-ghost"> | ||
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16m-16 6h16" /></svg> | ||
</label> |
Oops, something went wrong.