api-server icon indicating copy to clipboard operation
api-server copied to clipboard

Version list seems entirely random. Could it be properly sorted?

Open joshgoebel opened this issue 4 years ago • 2 comments

Description

The version sorting seems to have no rhyme or reason.

Steps to reproduce

  • Visit page: https://cdnjs.com/libraries/highlight.js
  • Open dropdown.

Expected behavior

The order would be newest first, followed by older releases in release (or at least version order). IE something like:

  • 11.0.1
  • 11.0.0
  • 11.0.0-beta2
  • 11.0.0-beta1
  • 10.7.3
  • 10.7.2
  • 10.7.2-beta0
  • 10.x ...
  • 9.x ...
  • 8.x ...

Screenshots

Screen Shot 2021-06-05 at 11 08 29 PM Screen Shot 2021-06-05 at 11 08 36 PM

joshgoebel avatar Jun 06 '21 03:06 joshgoebel

👋 The website currently does not sort the versions at all, and relies on what is returned by the cdnjs API, and ultimately the KV store that has all the library metadata.

This can be seen if you request the library from the API: https://api.cdnjs.com/libraries/highlight.js?fields=versions I'll transfer this over to the API repo so that folks can look at potentially adding sorting there.

MattIPv4 avatar Jun 06 '21 11:06 MattIPv4

@MattIPv4 Thanks!

joshgoebel avatar Jun 06 '21 11:06 joshgoebel