bruth/jekyll-docs-template

Sidebar sort order sorts lexicographically (1, 10, 2), not numerically

troy opened this issue · 1 comments

troy commented

order currently sorts: 0, 1, 10, 11, .. 2 because Javascript's sort method defaults to lexicographic sorting; details. That page has an example comparison function to sort numerically:

function compareNumbers(a, b) {
  return a - b;
}

Thank you