eleventy-navigation icon indicating copy to clipboard operation
eleventy-navigation copied to clipboard

Change default `order` sort

Open TigersWay opened this issue 4 years ago • 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 avatar Nov 12 '19 09:11 TigersWay

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

zachleat avatar Nov 12 '19 17:11 zachleat

@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... :(

dixonge avatar Apr 16 '20 19:04 dixonge

Is there anyway to order items alphabetically by default?

aaronstezycki avatar Sep 25 '20 11:09 aaronstezycki

All troubles are coming from here: https://github.com/11ty/eleventy-navigation/blob/c05ff04795bb9562725b01d0c773ada3b87770f0/eleventy-navigation.js#L18

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

I could prepare a PR... (?)

TigersWay avatar Sep 26 '20 05:09 TigersWay