Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add the ability to sort by date field. #173

Closed
iveptawebadmin opened this issue Nov 9, 2021 · 5 comments
Closed

Enhancement: Add the ability to sort by date field. #173

iveptawebadmin opened this issue Nov 9, 2021 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@iveptawebadmin
Copy link

Currently, you can sort by last modified, but my content doesn't have that field.
The file list shows the 'date' field that I do have in my content, but I can't sort files by it.

image

@estruyf
Copy link
Owner

estruyf commented Nov 10, 2021

This can be linked to #76 as I want to allow open sorting based on anything you define.

Currently, the last modified sorting is done based on the file stats itself, not from a metadata field in the file,

@estruyf estruyf added the enhancement New feature or request label Nov 10, 2021
@estruyf estruyf added this to the 5.5.0 milestone Nov 10, 2021
@estruyf
Copy link
Owner

estruyf commented Nov 10, 2021

Support for custom sorting will be added in 5.5.0. You can already test it out in the latest beta. For this, a new setting has been added. More information about it can be found here: https://beta.frontmatter.codes/docs/settings#frontmatter.content.sorting

"frontMatter.content.sorting": [
  {
    "title": "Date (asc)",
    "name": "date",
    "order": "asc",
    "type": "date"
  },
  {
    "title": "Date (desc)",
    "name": "date",
    "order": "desc",
    "type": "date"
  }
]

@bwklein
Copy link

bwklein commented Nov 12, 2021

It works as expected in beta. One preference I would have is to find a way to preserve the last chosen sort method, so that when you go back to the Dashboard, the same sort as last time is applied.

@estruyf
Copy link
Owner

estruyf commented Nov 12, 2021

Again, a great suggestion!

estruyf added a commit that referenced this issue Nov 12, 2021
@estruyf
Copy link
Owner

estruyf commented Nov 12, 2021

@bwklein sorting state is now kept. So when opening the dashboard again, it will use the last used selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants