Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v2): allow negative sidebar positions
In some cases, negative sidebar positions can be useful for reversing the sorting order with minimal maintenance overhead. For example, a docs folder with changelogs for historical versions should be sorted in reverse chronological order. This is easy to do for semantic version numbers by converting them into a negative numerical representation, e.g. 11.5.1 -> -110501. The alternative is to make the first version start with a large position number (e.g. 9999) and decrement it for each version. However, this requires referring to older versions to get the current sequence number, thus increasing maintenance overhead. It also makes the number less intuitive and more prone to error. Negative sidebar positions work great for this purpose, so make the front matter validator allow them again as #4796 broke this use case.
- Loading branch information