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

Support standard byte order sorting #1573

Closed
wants to merge 1 commit into from
Closed

Support standard byte order sorting #1573

wants to merge 1 commit into from

Conversation

adriangoransson
Copy link

This PR adds the sort_order property to sections that defaults to
lexical in order to keep backwards compatability and adds "standard" for
byte order sort.

This is useful if you have a list of non-english names and you want them
sorted correctly. My site is in Swedish and with natural sort åäö (our
last three letters of the alphabet) end up in the same position as aao
respectively.

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
Didn't realize this was a requirement for feature additions (as well as requests).. Sorry!

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

This PR is a continuation of #1315 which added natural sort order. Unfortunately that sort order wasn't perfect for my use case.

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

@Keats
Copy link
Collaborator

Keats commented Aug 4, 2021

Thanks, that's definitely something of interest.

There was also Keats/tera#460 for sorting in Tera and I'm wondering how that works for non alphabetic languages.
I feel like it should probably be more a different sort_by value than a new configuration to keep things simple, unless we need to add a third order type.

What do you think of https://zola.discourse.group/t/remove-lighter-heavier-and-earlier-later/767/8 ?

@adriangoransson
Copy link
Author

Thanks for taking the time to review!

I feel like it should probably be more a different sort_by value than a new configuration to keep things simple, unless we need to add a third order type.

If you mean something like sort_by = "title_standard" , I considered it but think having a sort order separate is more flexible if at some point order_by would support extra.*. Though I don't know if that would be of interest to have.

What do you think of https://zola.discourse.group/t/remove-lighter-heavier-and-earlier-later/767/8 ?

I make no use of next/prev references but greater/smaller sounds great and easy to use to me!

This PR adds the `sort_order` property to sections that defaults to
lexical in order to keep backwards compatability and adds "standard" for
byte order sort.

This is useful if you have a list of non-english names and you want them
sorted correctly. My site is in Swedish and with natural sort åäö (our
last three letters of the alphabet) end up in the same position as aao
respectively.
@Keats
Copy link
Collaborator

Keats commented Jun 13, 2022

I've finally added that in the next branch: 5873e03
Started the commit from scratch as the code changed a lot since that PR.

Better late than never!

@Keats Keats closed this Jun 13, 2022
@adriangoransson adriangoransson deleted the next branch June 14, 2022 06:15
@adriangoransson
Copy link
Author

Thanks for your hard work! It's appreciated. :)

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

Successfully merging this pull request may close these issues.

2 participants