mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-11 11:22:53 +02:00
#402: Custom sorting of content now supports number fields
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
- [#388](https://github.com/estruyf/vscode-front-matter/issues/388): New stop server action has been added to the panel
|
||||
- [#390](https://github.com/estruyf/vscode-front-matter/issues/390): Implement another JSON parser in order to be able to parse the `frontmatter.json` file better
|
||||
- [#394](https://github.com/estruyf/vscode-front-matter/issues/394): Ordering of snippet fields is based on their field definition
|
||||
- [#402](https://github.com/estruyf/vscode-front-matter/issues/402): Custom sorting of content now supports `number` fields
|
||||
|
||||
### ⚡️ Optimizations
|
||||
|
||||
|
||||
+2
-1
@@ -329,7 +329,8 @@
|
||||
"default": "string",
|
||||
"enum": [
|
||||
"string",
|
||||
"date"
|
||||
"date",
|
||||
"number"
|
||||
],
|
||||
"description": "Type of the field value"
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ export default function usePages(pages: Page[]) {
|
||||
pagesSorted = pagesSorted.sort(Sorting.alphabetically(name));
|
||||
} else if (type === SortType.date) {
|
||||
pagesSorted = pagesSorted.sort(Sorting.date(name));
|
||||
} else if (type === SortType.number) {
|
||||
pagesSorted = pagesSorted.sort(Sorting.number(name));
|
||||
}
|
||||
|
||||
if (order === SortOrder.desc) {
|
||||
|
||||
Reference in New Issue
Block a user