diff --git a/pkg/futhorc/orderer.go b/pkg/futhorc/orderer.go index 9eeb032..ed7d949 100644 --- a/pkg/futhorc/orderer.go +++ b/pkg/futhorc/orderer.go @@ -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) }) diff --git a/pkg/futhorc/post.go b/pkg/futhorc/post.go index 6693ea9..e7b68cc 100644 --- a/pkg/futhorc/post.go +++ b/pkg/futhorc/post.go @@ -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 }