fix bug in post sorting
All checks were successful
/ Deploy blog to deuterium (push) Successful in 1m50s

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2024-11-29 08:02:43 -05:00
parent e2dd1afaa3
commit 6a17f7ed45

View file

@ -166,7 +166,9 @@ func (pl *postList) fetchLocked(filename string) error {
if err != nil {
return err
}
defer slices.SortFunc(pl.posts, postLess)
defer func() {
slices.SortFunc(pl.posts, postLess)
}()
for i, post := range pl.posts {
if post.Slug == p.Slug {
pl.posts[i] = p