Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
* previously paniced on zero posts
* previously marshaled tags incorrectly
  • Loading branch information
weberc2-tempus committed Apr 22, 2024
1 parent 1ea0541 commit b6daf68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/futhorc/orderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func (orderer *Orderer[T]) Run(ctx context.Context) error {
}

func OrderPages[T any](orderedPages []OrderedPage[T]) {
if len(orderedPages) < 1 {
return
}

slices.SortFunc(orderedPages, func(a, b OrderedPage[T]) int {
return b.Compare(&a.Page)
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/futhorc/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type Link struct {
URL template.URL
}

func (l *Link) MarshalYAML() (interface{}, error) {
func (l Link) MarshalYAML() (interface{}, error) {
return l.Text, nil
}

Expand Down

0 comments on commit b6daf68

Please sign in to comment.