hswg: add categories
This commit is contained in:
+6
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user