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

Write SVG files to gist #24

Closed
runarberg opened this issue Sep 27, 2023 · 0 comments · Fixed by #25
Closed

Write SVG files to gist #24

runarberg opened this issue Sep 27, 2023 · 0 comments · Fixed by #25

Comments

@runarberg
Copy link
Contributor

There is no need to write a JSON to send as data to shields.io. Instead you can create the SVG icon directly in the gist by generating the icon with the same node library that shields.io publishes. Then the url path to the icon in your README becomes a lot easier:

![coverage badge](https://gist.github.com/<username>/<gistID>/filename.svg)

So I have a feature request: If the filename ends with .svg instead of .json we can generate the icon and post the SVG straight to the gist.

I have a proof of concept in a fork: https://github.com/runarberg/dynamic-badges-action

runarberg added a commit to runarberg/dynamic-badges-action that referenced this issue Oct 5, 2023
This adds the posibility of saving an SVG badge generated by the same
shields.io dirictly to the gist. Instead of prepering a JSON file to
be sent to their service, we use their library directly, which outputs
an SVG file that we can save to the user’s gist.

Filenames ending in `.svg` will use this library automatically.

Additionally there is a major refactoring where the older `node:http`
library has been swapped out for `fetch`.

Also swap from node 16 to node 20

fixes Schneegans#24
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 a pull request may close this issue.

1 participant