jooy2 / vitepress-sidebar

🔌 VitePress Sidebar is a plugin for VitePress that automatically configures and manages the sidebar of your page with simple settings.
https://vitepress-sidebar.cdget.com
MIT License
144 stars 7 forks source link

[Feature Request] sortMenusOrderByDescending for frontmatter `date:` #138

Closed maxwowpow closed 5 months ago

maxwowpow commented 7 months ago

Current state of things

Currently for the sortMenusOrderByDescending

... This option is only enabled when sortMenusByName or sortMenusByFrontmatterOrder is true.

Proposition

How about making it active for frontmatter's date: 2024-02-10 parameter?

so

bar.md

---
date: 2024-02-09
---

foo.md
---
date: 2024-02-10
---

with sortMenusOrderByDescending === true and e.g. sortMenusByFrontmatterDate === true

would result in

foo
bar

Reasoning

E.g. Docusaurus uses this approach, so e.g. guys migrating from docusaurus would not need to modify their articles.

PS: I've never seen blogs with articles sorted by title... rather it's typical to have the articles listed chronologically. So some kind of date is used.

jooy2 commented 5 months ago

Hello, thank you for using vitepress-sidebar. The feature you requested was added in version 1.20.0 with the sortMenusByFrontmatterDate option. Please refer to the README.md file for more information.

Thank you for your feature request and please open a new issue if you encounter any further issues.

Regards,