Any way to sort globally but keep folders on top? #201
-
|
I'd like to apply a simple sort based on frontmatter (a date created field) to everything in my vault, but always keep folders & subfolders stacked at the top. I've looked at docs and it seems like a global sort always mixes folders in with files. Is there a way to accomplish this? |
Beta Was this translation helpful? Give feedback.
Answered by
SebastianMC
Apr 23, 2025
Replies: 1 comment 1 reply
-
|
Hi @toddz262 to accomplish what you describe use the below sorting specification: ---
sorting-spec: |
target-folder: /*
> a-z by-metadata: date created
/folders
/:files
---The specification if pretty self-explanatory:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
toddz262
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @toddz262
to accomplish what you describe use the below sorting specification:
The specification if pretty self-explanatory:
target-folder: /*tells to apply the sorting which follows to all folders in the vault, including the root folder> a-z by-metadata: date createdsets the default order (inherited by all folders unless specified otherwise) bydate createdmetadata field, newest items on top (aka descending order by date)/foldersgroups (sub)folders first and puts them in the top of the sorted folder/:filesputs files below folders (this line kept for clarity and can be omitted - …