Closed searls closed 3 months ago
Yes, this is an easy enough option to pass through! I'll wire that up.
That'd be incredible, thank you!On Nov 22, 2023, at 20:55, Liam Bigelow @.***> wrote: Yes, this is an easy enough option to pass through! I'll wire that up.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Hey @searls — this is available for you to start using in a 1.0.5-rc0
release of Pagefind 🙂
Awesome, thank you!
I just tested this out and it's not working for me.
My markup includes date metadata and sort attributes:
<time pubdate="" datetime="2010-12-07" data-pagefind-meta="date:2010-12-07" data-pagefind-sort="date:2010-12-07" class="block mb-2 text-sm font-semibold text-center text-secondary">
Tuesday, Dec 7, 2010
</time>
My JS:
window.pageFindUi = new PagefindUI({
element: "#search",
resetStyles: false,
autofocus: true,
sort: { date: "desc" }
});
But when I search, results are out-of-order:
I deployed this so you can see a live version: justin.searls.co/search
🤦 This is why I publish prereleases! My bad — sorry about that.
v1.0.5-rc1
is out now 🙂
Fixed! Looks good.
Also, you'll want to remove this line from the sorting docs:
Sorting is currently only supported when interacting with the Pagefind JS API directly.
I hope that the official release v1.0.5 that includes sorting in the Default UI will happen soon. This feature is much needed. I use the standalone binary of pagefind
from GitHub. Thank you!
Will the default UI support sorting by multiple keys? E. g. sort: { score: "desc", title: "asc" }
meaning sort by score
first and then in each group of elements with the same score sort by title
.
Sorry for the delay all! This has now landed in the v1.1.0 release :-)
I'm just dropping by to say thank you! I've been hoping for this feature for years, and it's working like a charm <3
Since filtering is supported in the Default UI, I was wondering if the maintainers are opening to adding support for sorting in the Default UI as well? I was surprised that to simply sort results in reverse-chronological order I would need to throw out the Default UI and roll my own, for instance.
The interface I'd like is:
I imagine this would entail forwarding this option along all the way to this line, much in the same way
filters
is.