Repository navigation
Serve the installs badges as JSON for shields.io too - #35
Merged
Merged
Conversation
The VS Code Marketplace only shows README badges from services it knows, so an
extension's README can't use this site's SVG. /p/{slug}/badge.json and
/p/{slug}/extensions/{id}/badge.json answer in shields.io's endpoint schema, and the
extension page gives the README line for both.
This was referenced Oct 28, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
vscerefuses SVG images in a README unless they come from a service it trusts ("SVGs are restricted in README.md"), and shields.io is one of them. An extension's README therefore can't point at/p/{slug}/.../badge.svg. It can usehttps://img.shields.io/endpoint?url=<our JSON>.What
GET /p/{slug}/badge.jsonandGET /p/{slug}/extensions/{id}/badge.jsonreturn shields.io's endpoint schema, for example{"schemaVersion":1,"label":"installs","message":"12.3k","color":"256abf","cacheSeconds":3600}.Badge.COLORis shared by the SVG and the JSON, so both badges look the same.Tests
PublicPagesTests: the JSON fields, the headers and the 404s.DashboardPagesTests: both README lines appear once a public page exists../mvnw verifypasses: 181 tests.