-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Sort by a new sticky
parameter
#51
Conversation
https://github.com/mziccard/node-timsort There is a high performance tim-sort implementation that could be used as an alternative. |
Another approach is const posts = locals.posts.sort(`${config.index_generator.order_by} -sticky`); However, the current implementation of warehouse does not support setting default values for sort (e.g. sticky = 0), thus the sorting will not take effect unless every post has a hexo-generator-index/test/index.js Lines 20 to 22 in 88843c2
|
Test cases / docs will be updated later.
Node.js 12+ uses stable sorting algorithms by default, thus
timsort
is only used for Node.js 10 compatibility. It should be replaced after Node.js 10 EOL.https://v8.dev/features/stable-sort