Skip to content

Add mod status badges + abbreviate query param on mod info#63

Open
TreehouseFalcon wants to merge 4 commits intogeode-sdk:mainfrom
TreehouseFalcon:main
Open

Add mod status badges + abbreviate query param on mod info#63
TreehouseFalcon wants to merge 4 commits intogeode-sdk:mainfrom
TreehouseFalcon:main

Conversation

@TreehouseFalcon
Copy link

@TreehouseFalcon TreehouseFalcon commented Mar 21, 2026

Description

This pull proposes new Geode-branded status badges for use on the web! These badges are powered by Shields.IO and allow mod consumers to get automatically up-to-date information about the state of a mod by looking at the repository.
Badges can be generated from any of these four attributes:

  • version
  • geode_version
  • gd_version
  • downloads

Additionally, there is a new abbreviated query parameter added to the /mods/{id} route. This allows the Downloads badge to show a short-hand representation of download count.

image

Copy link
Author

Choose a reason for hiding this comment

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

Do we want to serve these statically from the web application?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I have a plan to add app storage (which would have to be served statically by the reverse proxy) in #60, though that PR is WIP.

I could backport the storage bit to main.

@TreehouseFalcon TreehouseFalcon marked this pull request as ready for review March 21, 2026 23:25
Copy link
Collaborator

@Fleeym Fleeym left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Left a bit of feedback on it.

I'll backport the storage stuff from #60 so that you're able to use it here.

}

// If abbreviate param is set, abbreviate download_count fields
let mut payload = serde_json::to_value(&the_mod).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a pretty janky solution, the data should remain as Mod.

Maybe create a custom type DownloadCount for the field that can be abbreviated that just holds the count and a boolean that tells if the Serialize impl result should be abbreviated or not?

https://serde.rs/impl-serialize.html, for reference.

Copy link
Author

Choose a reason for hiding this comment

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

I've added a download_count model, is this what you're looking for?

@Fleeym
Copy link
Collaborator

Fleeym commented Mar 24, 2026

Backported the storage in #64, just move the .svgs to storage/public/shields/... (don't forget the gitignore!)

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.

2 participants