jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
6.82k stars 2.47k forks source link

Manually Sort Listings from FolderPage Plugin #1227

Closed ExodosPavilion closed 2 months ago

ExodosPavilion commented 3 months ago

Is your feature request related to a problem? Please describe. There is no way to manually set the order for the files the FolderPage plugin will display in the index

Describe the solution you'd like I would like it if the FolderPage plugin allowed us to set the order in which to display the files it finds. I don't mean sorting it such that its in alphabetical order or something. I mean being able to order it manually. (something weird like Part 3 then Part 7 and then Part 1 displayed in that order)

Describe alternatives you've considered I don't understand coding enough to modify the FolderPage plugin or FolderContent.tsx.

Additional context Maybe it can be something we set in the Frontmatter section of the index

---
title: Example Title
draft: false
order: ['Part 3.md', 'Part 7.md', 'Part 1.md']
---

or other relevant markdown files

---
title: Part 3
draft: false
page: 1
---

Personally I think the second option is better.

cmj2002 commented 3 months ago

I also need this feature, but with a slight difference. I hope to be able to pass in a custom sorting function like Explorer to achieve this. Of course, you can implement manual sorting by writing specific custom sorting functions. I will soon submit a PR (and link it to this issue).