From c02bced4feeec771bd19cdfe0f40931259576814 Mon Sep 17 00:00:00 2001 From: gutmet Date: Wed, 3 May 2023 19:05:44 +0200 Subject: [PATCH] sort subpages by title --- site/site.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/site.go b/site/site.go index 2cc1b34..fc3e323 100644 --- a/site/site.go +++ b/site/site.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "path/filepath" + "sort" "strings" "text/template" @@ -36,6 +37,7 @@ func (m *metadata) getSubpages() []Subpage { ret = append(ret, subpage) } } + sort.Slice(ret, func(i, j int) bool { return strings.ToUpper(ret[i].Title) < strings.ToUpper(ret[j].Title) }) return ret }