Skip to content

Commit

Permalink
Explicitly order menu and content types automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
apexskier committed Oct 24, 2020
1 parent e362f1e commit 27e6fbe
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions content/kitchen/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
title: "In the kitchen"
rss: true
menu:
main:
weight: 50
---
2 changes: 1 addition & 1 deletion content/pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: About
url: /about/
menu:
main:
identifier: about
weight: 10
---

I’m a software engineer at [Remitly](https://grnh.se/3c4028751), where I’m
Expand Down
2 changes: 1 addition & 1 deletion content/pages/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Projects
url: /projects/
menu:
main:
identifier: projects
weight: 40
tags: ["apps"]
---

Expand Down
3 changes: 3 additions & 0 deletions content/posts/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
title: "Posts"
rss: true
menu:
main:
weight: 20
---
17 changes: 10 additions & 7 deletions layouts/partials/primaryNavigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
<label class="mobile-toggle-on" for="menu-toggle">Menu</label>
<label class="mobile-toggle-off" for="menu-toggle">Close</label>
<ul class="links">
{{- $currentPage := . }}
<li><a href="{{ relref . "/" }}" title="Home">Home</a> {{ if .IsHome }}<span aria-label="Active"></span>{{ end }}</li>
{{ range .Site.Menus.main -}}
{{ $currentPage := . }}
<li>
<a href="{{ relref . "/" }}" title="Home">Home</a>
{{ if .IsHome }}<span aria-label="Active"></span>{{ end }}
</li>
{{ range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">{{ .Title }}</a>
{{- if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) -}}
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
<span aria-label="active"></span>
{{- end -}}
{{ end }}
</li>
{{ end }}
{{ range ((where .Site.Pages "Params.rss" true) | append (where .Site.Pages "Kind" "taxonomyTerm")) }}
{{ range (where .Site.Pages "Kind" "taxonomyTerm") }}
{{ if ne .Type "pages" }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{- if eq . $ }}<span aria-label="active"></span>{{ end -}}
{{ if eq . $ }}<span aria-label="active"></span>{{ end }}
</li>
{{ end }}
{{ end }}
Expand Down

0 comments on commit 27e6fbe

Please sign in to comment.