Skip to content
Permalink
Browse files
Explicitly order menu and content types automatically
  • Loading branch information
apexskier committed Oct 24, 2020
1 parent e362f1e commit 27e6fbe86464ccb7e1664f0ede2b0220894a9ecf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
@@ -1,4 +1,7 @@
---
title: "In the kitchen"
rss: true
menu:
main:
weight: 50
---
@@ -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
@@ -3,7 +3,7 @@ title: Projects
url: /projects/
menu:
main:
identifier: projects
weight: 40
tags: ["apps"]
---

@@ -1,4 +1,7 @@
---
title: "Posts"
rss: true
menu:
main:
weight: 20
---
@@ -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 }}

0 comments on commit 27e6fbe

Please sign in to comment.