1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 00:21:16 -04:00

use Hugo's native menu config for nav bar links

This commit is contained in:
2020-03-25 09:13:29 -04:00
parent a37e749064
commit 56ec12a0fa
2 changed files with 27 additions and 5 deletions

View File

@@ -47,6 +47,29 @@ disableAliases = true
linkedin = "jakejarvis" linkedin = "jakejarvis"
mastodon = "pogge.rs/@jake" mastodon = "pogge.rs/@jake"
[menu]
[[menu.main]]
name = "Home"
pre = "🏠"
url = "/"
weight = -100
[[menu.main]]
name = "Notes"
pre = "📝"
url = "/notes/"
weight = -90
[[menu.main]]
name = "GitHub"
pre = "👨‍💻"
url = "https://github.com/jakejarvis"
weight = -80
[[menu.main]]
name = "Email"
pre = "📬"
# encode my email address -- probably not effective but why not?
url = "mailto:jake@jarv.is"
weight = -70
[outputs] [outputs]
home = ["HTML", "RSS", "ALGOLIA", "MANIFEST", "REDIRECTS", "HEADERS"] home = ["HTML", "RSS", "ALGOLIA", "MANIFEST", "REDIRECTS", "HEADERS"]
section = ["HTML"] section = ["HTML"]

View File

@@ -1,14 +1,13 @@
<header> <header>
<nav> <nav>
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" title="{{ .Site.Title }}" aria-label="{{ .Site.Title }}"> <a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" aria-label="{{ .Site.Title }}">
{{ partialCached "page/logo" . }} {{ partialCached "page/logo" . }}
<h1 id="name">{{ .Site.Title }}</h1> <h1 id="name">{{ .Site.Title }}</h1>
</a> </a>
<ul> <ul>
<li><a class="no-underline" href="{{ .Site.BaseURL }}" title="Home"><span class="emoji">&#x1F3E0;</span><span class="text">Home</span></a></li> {{- range .Site.Menus.main }}
<li><a class="no-underline" href="{{ "notes/" | absURL }}" title="Notes"><span class="emoji">&#x1F4DD;</span><span class="text">Notes</span></a></li> <li><a class="no-underline" {{ printf "href=%q" .URL | safeHTMLAttr }} aria-label="{{ .Name }}"{{ if strings.HasPrefix .URL "http" }} target="_blank" rel="me noopener"{{ end }}><span class="emoji">{{ .Pre }}</span><span class="text">{{ .Name }}</span></a></li>
{{ with .Site.Author.github }}<li><a class="no-underline" href="https://github.com/{{ . }}" title="GitHub" target="_blank" rel="me noopener"><span class="emoji">&#x1F468;&#x200D;&#x1F4BB;</span><span class="text">GitHub</span></a></li>{{ end }} {{ end -}}
<li><a class="no-underline" href="&#x6D;&#x61;&#x69;&#x6C;&#x74;&#x6F;&#x3A;&#x6A;&#x61;&#x6B;&#x65;&#x40;&#x6A;&#x61;&#x72;&#x76;&#x2E;&#x69;&#x73;" title="Email Me"><span class="emoji">&#x1F4EC;</span><span class="text">Email</span></a></li>
</ul> </ul>
</nav> </nav>
</header> </header>