question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: Enable custom sorting on integer fields

See original GitHub issue

Is your feature request related to a problem? Please describe.

I’m trying to define a custom sorting option for my content, which logically follows weights by folder and subfolder. Unfortunately, the only valid options for type in frontMatter.content.sorting seem to be date and string. This definition is invalid:

Describe the solution you’d like

I would like for this definition to be valid and order my content by weight from lowest integer value to highest:

"frontMatter.content.sorting": [
  {
    "id": "byWeight",
    "title": "By Weight",
    "name": "weight",
    "order": "asc",
    "type": "integer"
  }
]

Describe alternatives you’ve considered

I can’t think of any, since Front Matter isn’t aware of how my static site generator will eventually order my content.

Additional context

N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michaeltlombardicommented, Sep 12, 2022

Yup! That fixed it for me! 😊 I’ll leave it on beta since I’m almost certainly going to stay out on the edge like this 😅

1reaction
estruyfcommented, Sep 12, 2022

A new schema version was released on the beta docs, which should fix the schema issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom sort order for an enum field - hibernate - Stack Overflow
One option is to sort by the ordinal of the enum. · A second option is to convert the enum to an Entity...
Read more >
Sorting Modes and Custom Sorting | WPF Controls
Sorts a column's data by its edit values. To enable this mode, set the ColumnBase.SortMode property to ColumnSortMode.Value. Sorting by Display ...
Read more >
Custom Sorting - WinForms GridView Control - Telerik UI for ...
Custom sorting is applied if user sorting is enabled by the EnableSorting or GridViewTemplate.EnableSorting properties. By default, sorting is enabled at all ...
Read more >
Angular Data Grid: Row Sorting
This page describes how to sort row data in the grid and how you can customise that sorting to match your requirements.
Read more >
Tableau Hack: How to Sort by Multiple Data Types
We have created a custom sort that allows the user to choose which measure or dimension to sort on. We have also added...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found