Skip to content

Commit

Permalink
Merge pull request #478 from hlxsites/sort-topics
Browse files Browse the repository at this point in the history
chore: sort topics based on title alphabetically
  • Loading branch information
duynguyen authored Nov 22, 2023
2 parents 4beda93 + 1c7cba7 commit ac0d534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/topic-list/topic-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function fetchTopicsForCategory(category) {
const topics = await ffetch('/us/en/products-index.json')
.filter(({ fullCategory, type }) => fullCategory === category && type === 'Topic')
.all();
return topics.sort((item1, item2) => item2.lastModified - item1.lastModified);
return topics.sort((item1, item2) => item1.title.localeCompare(item2.title));
}

export default async function decorate(block) {
Expand Down

0 comments on commit ac0d534

Please sign in to comment.