Skip to content

Commit 27e6fbe

Browse files
committed
Explicitly order menu and content types automatically
1 parent e362f1e commit 27e6fbe

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

content/kitchen/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
22
title: "In the kitchen"
33
rss: true
4+
menu:
5+
main:
6+
weight: 50
47
---

content/pages/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: About
33
url: /about/
44
menu:
55
main:
6-
identifier: about
6+
weight: 10
77
---
88

99
I’m a software engineer at [Remitly](https://grnh.se/3c4028751), where I’m

content/pages/projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Projects
33
url: /projects/
44
menu:
55
main:
6-
identifier: projects
6+
weight: 40
77
tags: ["apps"]
88
---
99

content/posts/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
22
title: "Posts"
33
rss: true
4+
menu:
5+
main:
6+
weight: 20
47
---

layouts/partials/primaryNavigation.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@
33
<label class="mobile-toggle-on" for="menu-toggle">Menu</label>
44
<label class="mobile-toggle-off" for="menu-toggle">Close</label>
55
<ul class="links">
6-
{{- $currentPage := . }}
7-
<li><a href="{{ relref . "/" }}" title="Home">Home</a> {{ if .IsHome }}<span aria-label="Active"></span>{{ end }}</li>
8-
{{ range .Site.Menus.main -}}
6+
{{ $currentPage := . }}
7+
<li>
8+
<a href="{{ relref . "/" }}" title="Home">Home</a>
9+
{{ if .IsHome }}<span aria-label="Active"></span>{{ end }}
10+
</li>
11+
{{ range .Site.Menus.main }}
912
<li>
1013
<a href="{{ .URL }}">{{ .Title }}</a>
11-
{{- if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) -}}
14+
{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}
1215
<span aria-label="active"></span>
13-
{{- end -}}
16+
{{ end }}
1417
</li>
1518
{{ end }}
16-
{{ range ((where .Site.Pages "Params.rss" true) | append (where .Site.Pages "Kind" "taxonomyTerm")) }}
19+
{{ range (where .Site.Pages "Kind" "taxonomyTerm") }}
1720
{{ if ne .Type "pages" }}
1821
<li>
1922
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
20-
{{- if eq . $ }}<span aria-label="active"></span>{{ end -}}
23+
{{ if eq . $ }}<span aria-label="active"></span>{{ end }}
2124
</li>
2225
{{ end }}
2326
{{ end }}

0 commit comments

Comments
 (0)