Add support for standard main menu (#6)

This commit is contained in:
Andrew 2020-06-27 17:33:38 +01:00 committed by GitHub
parent 17af6e51ae
commit 0e080d23bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -12,6 +12,21 @@ pygmentsUseClasses = true
dark = "auto"
highlight = true
[menu]
[[menu.main]]
identifier = "posts"
name = "posts"
title = "posts"
url = "/"
weight = 10
[[menu.main]]
identifier = "about"
name = "about"
title = "about"
url = "/about/"
weight = 20
[permalinks]
posts = "/:title/"

View file

@ -2,10 +2,9 @@
<h2><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h2>
<nav>
<ul>
<li><a href="{{ .Site.BaseURL }}">posts</a></li>
{{ range where .Site.Home.Pages "Title" "!=" "Posts" }}
{{ range .Site.Menus.main.ByWeight }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ .Pre }}<a href="{{ .URL }}" title="{{ .Title }}">{{- .Name -}}</a>{{ .Post }}
</li>
{{ end }}
</ul>