Skip to content
New issue

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

options for svg badge #16

Open
r3mi opened this issue May 4, 2014 · 6 comments
Open

options for svg badge #16

r3mi opened this issue May 4, 2014 · 6 comments

Comments

@r3mi
Copy link

r3mi commented May 4, 2014

It seems it is possible to get a SVG badge by replacing the .png extension in the URL with .svg , e.g. https://nodei.co/npm/node.svg
However, it works only for the default badge : adding options reverts to a PNG image, e.g. https://nodei.co/npm/node.svg?compact=true.
Is it the intended behavior ? Or is SVG unsupported, given it is not described on the homepage ?

r3mi added a commit to r3mi/poly2tri.js that referenced this issue May 4, 2014
done for badge.fury.io
waiting for nodei.co, see rvagg/nodei.co#16
@rvagg
Copy link
Owner

rvagg commented May 5, 2014

@r3mi unsupport "officially", it's something I've been tinkering with. The main holdup is that I need to spend some time figuring out the optimal fonts (and font sizes) to use across platforms. You're welcome to contribute if you're interested.

Here's the diff of commits introducing SVG support so far: 9b13e1c...16c538e

Beyond fonts, we need all the options, plus the download histograms.

Mithgol referenced this issue in alexgorbatchev/crc May 22, 2014
@yuchi
Copy link

yuchi commented Feb 12, 2015

Are you still interested in this?

@rvagg
Copy link
Owner

rvagg commented Feb 13, 2015

yes, got some time to spare tinkering with this?

@yuchi
Copy link

yuchi commented Feb 16, 2015

Yes and no, but I’d like to see all those badges in hi-res and looks like an easy enough task to contribute back to this great project.

@GarthDB
Copy link

GarthDB commented Jul 17, 2016

Another thing to tack on to the svg support - sending the correct headers. Right now the content-type is text/html

$ curl -L -I https://nodei.co/npm/topmarks.svg
HTTP/1.1 200 OK
x-startup: Tue Jul 12 2016 02:37:01 GMT+0000 (UTC)
x-powered-by: whatevs
cache-control: no-cache
Content-Type: text/html
Content-Length: 2573
Date: Sun, 17 Jul 2016 17:12:26 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains

It should be set to image/svg+xml

@GarthDB
Copy link

GarthDB commented Jul 17, 2016

I can open it as a new issue if you'd prefer.

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

No branches or pull requests

4 participants