Added characters page
This commit is contained in:
18
pages/characters/latest.go
Normal file
18
pages/characters/latest.go
Normal file
@ -0,0 +1,18 @@
|
||||
package characters
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
)
|
||||
|
||||
// Latest characters.
|
||||
func Latest(ctx *aero.Context) string {
|
||||
characters := fetchAll()
|
||||
|
||||
sort.Slice(characters, func(i, j int) bool {
|
||||
return characters[i].Created > characters[j].Created
|
||||
})
|
||||
|
||||
return render(ctx, characters)
|
||||
}
|
Reference in New Issue
Block a user