11ty/eleventy-navigation

Change default `order` sort

TigersWay opened this issue · 4 comments

Hi,
Default order value = 0, means not-ordered items are going to be before the ordered ones....
Shouldn't it be the opposite?

@TigersWay hmm—yeah, that makes sense. This will require a major version bump.

@TigersWay hmm—yeah, that makes sense. This will require a major version bump.

Any timeframe on this? I'm still finding things sorting extremely randomly, and am unwilling to specify order for 100+ nav items. Guess I'm probably pushing the limits of the concept of a 'nav menu' and should probably just use collections.all as an index or something... :(

Is there anyway to order items alphabetically by default?

All troubles are coming from here:

return (a.order || 0) - (b.order || 0);

  • Only numeric ordering
  • 0 is default (unordered first)

I could prepare a PR... (?)