We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey dude, so, been using your template to learn a bit of Sveltekit, thanks for all the work.
You'll notice the blog/category categories isn't correctly alphabetically sorted, here's the code I used to fix it:
const sortedUniqueCategories = Object.values(uniqueCategories).sort((a, b) => { return a.title.localeCompare(b.title); });
The text was updated successfully, but these errors were encountered:
The above approach sorts by category name irrelevant of count.
To sort by count first and alphabetically within, you can use this:
const sortedUniqueCategories = Object.values(uniqueCategories).sort((a, b) => { return a.count === b.count ? a.title.localeCompare(b.title) : a.count > b.count; });
Sorry, something went wrong.
No branches or pull requests
Hey dude, so, been using your template to learn a bit of Sveltekit, thanks for all the work.
You'll notice the blog/category categories isn't correctly alphabetically sorted, here's the code I used to fix it:
The text was updated successfully, but these errors were encountered: