Skip to content

feat(scripts): sort the gallery feed by title, not slug#401

Open
amylin1249 wants to merge 2 commits into
mainfrom
sort-feed-by-title
Open

feat(scripts): sort the gallery feed by title, not slug#401
amylin1249 wants to merge 2 commits into
mainfrom
sort-feed-by-title

Conversation

@amylin1249

@amylin1249 amylin1249 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #396

The gallery feed was sorted by name (the slug), which isn't shown to users, so card order looked random. Now it will sort by title.

It also currently only triggers a re-sort when adding a new extension (requires manually re-sorting any time there is a title change to an existing extension), so I added that it will sort on every write in stringify()). Now, any release (a new extension or a title change to an existing one) reorders the whole feed automatically.

@amylin1249 amylin1249 marked this pull request as ready for review June 23, 2026 14:04
@amylin1249 amylin1249 requested review from dotNomad and karawoo June 23, 2026 14:04

@dotNomad dotNomad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change. I have one suggestion to move code to make it a bit easier to see

Comment thread scripts/extension-list.ts
Comment on lines +181 to +182
// Always emit a title-sorted feed so any release (new or updated) reorders.
this.sortExtensions();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this to stringify, which just configures and calls JSON.stringify, what do you think about calling sortExtensions prior to fs.writeFileSync(extensionListFilePath, list.stringify()); like so:

// Always emit a title-sorted feed so any release (new or updated) reorders.
list.sortExtensions();
fs.writeFileSync(extensionListFilePath, list.stringify());

We have to make sortExtensions public but that is fine. I think this is a bit clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update how content is ordered to alphabetical by title

2 participants