Open bloominburges opened 1 week ago
Hi @bloominburges,
the base idea of sorting specification which you described is:
---
sorting-spec: |
> a-z by-metadata: created
---
The above simple sorting spec works under the following assumptions:
sortspec
note in the folder which you want to sort. To sort a folder different than the location of sortspec
note you'd need to explicitly specify target-folder: path-of-target-folder-here
created
with values which can be ordered alphabetically when treating them as text. That means a date format like yyyy-mm-dd (e.g. 2024-11-16). If the format of values is different, e.g. date in US format mm/dd/yyyy (e.g. 11/16/2024) or - in general - format where day and/or month comes before the year, that obviously won't work. To deal with that type of formatted dates you need a feature requested here #171 (still in development)Got it… thanks. What about if i want reverse? I tried “> z-a by-metadata: created”, and it didn’t work
The syntax of sorting order specification in this particular example comprises three elements and two of them are relevant to your question:
>
>
stands for descending order, larger values go first. You can use more verbose syntax for it: order-desc:
as an equivalent for readability<
can be used for the ascending order, smaller values go first. Verbose equivalent syntax is order-asc:
To change the order direction to reverse you need to switch >
to <
, and vice versa
a-z
which represents the alphabetical sorting. It has no reverse equivalent and the direction specification (1) is used to switch between alphabetical and reverse alphabetical.The spec to use is then:
< a-z by-metadata: created
to put earlier dates first, and> a-z by-metadata: created
to put later dater first.
How do i use your add in to sort the files in a folder by the note’s “created” property in my YAML frontmatter? I want it to do it off of this frontmatter property, NOT the file property as the source of truth like some other admins do.
Thanks