hswg: add categories

This commit is contained in:
2026-06-24 19:27:10 +02:00
parent 821b3f6ab9
commit 115b612e47
+6 -2
View File
@@ -285,8 +285,12 @@ func writeIndex(path string, t *template.Template,
return err
}
// TODO(p): Splitting content to categories would be nice. Or tags.
return t.Execute(f, ordered)
categorised := map[string][]*Entry{}
for _, entry := range ordered {
category := entry.Attr("category")
categorised[category] = append(categorised[category], entry)
}
return t.Execute(f, categorised)
}
func finalizeEntries(entries *map[string]*Entry, t *template.Template,