Closed vgururao closed 4 years ago
is it enough/ok that the "random" order be fixed at build time? is it acceptable if we just start member list at some random location and then go in order?
just asking, not yet sure how to implement this. though i think i would build a new list members_random from the existing list in members, in member-list.html
Yes I think that will all work
On Sunday, August 2, 2020, tilnow notifications@github.com wrote:
is it enough/ok that the "random" order be fixed at build time? is it acceptable if we just start member list at some random location and then go in order?
just asking, not yet sure how to implement this. though i think i would build a new list members_random from the existing list in members, in member-list.html
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/The-Yak-Collective/yakcollective/issues/69#issuecomment-667711062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGMFW3S7E2YWU2SQOIVS5LR6WYZTANCNFSM4PR6WFTA .
looks like jekyll has a built in filter called sample
that does it. see also https://stackoverflow.com/questions/27179385/how-do-i-shuffle-the-order-of-an-array-in-jekyll
In particular: https://stackoverflow.com/a/59833695
Cut-and-paste between lines 10 and 11 in _layouts/member-list.html
, tweak some variable names, done.
...And I'm realizing that the entire approach with taking the modulo of the date that we've use elsewhere is way too complicated; we should just be piping the array we want to randomize to sample
, and then piping the output of that to first
to strip the "array-ness" off of the resulting single-element array.
the reason why i decided not to change that is that i now generate the "featured_one" as a number. that number is part of the site data and can be used all over the place.
`
pushed. works. see at https://inspiring-villani-8898ca.netlify.app/members/
The member directory should be sortable by alphabetical order as currently shown, but that should not be the default view since it arbitrarily over-exposes some members and under-exposes others. Default sort order should be some flavor of random, so at each visit you see a different few people above the fold. Other sort orders can be added (alphabetical, chronological by join date, project contribution karma...). Potentially integrate this idea with the "featured" member thing... where the featured member is also the random top member or something.