Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sortMenusByFrontmatterOrder not been sorted in numerical order but in string order #182

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

Cryolitia
Copy link
Contributor

@Cryolitia Cryolitia commented Sep 26, 2024

The behavior inconsistent with documentation:

Sorts the menu items by the order property of the frontmatter. For each folder, sorts the value (number) of the order property in ascending order, or descending order if the sortMenusOrderByDescending option is true. If the value of order is non-numeric or does not exist, order is judged to be 0.

The test samples are also unreasonable. Using 1 2 3 4 as samples will not be able to detect this error.

@jooy2
Copy link
Owner

jooy2 commented Sep 26, 2024

Hello! Thank you for your contribution to the project.

As you describe, it should have been sorted a little more clearly based on the values in frontmatter, I missed this point.
I don't see any particular problem with the code, so I'll merge it and release a new version. thanks!

@jooy2 jooy2 added the bug Something isn't working label Sep 26, 2024
@jooy2 jooy2 merged commit c8ced8d into jooy2:master Sep 26, 2024
9 checks passed
Cryolitia added a commit to project-trans/vitepress-theme-project-trans that referenced this pull request Sep 26, 2024
@jooy2
Copy link
Owner

jooy2 commented Sep 26, 2024

This change was released in vitepress-sidebar 1.27.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants