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

Add logo support #41

Open
jongracecox opened this issue Mar 20, 2020 · 6 comments
Open

Add logo support #41

jongracecox opened this issue Mar 20, 2020 · 6 comments

Comments

@jongracecox
Copy link
Owner

It would be nice to have the option to include logos in badges.

@jongracecox
Copy link
Owner Author

jongracecox commented Jun 23, 2020

In the same line as this, it would be nice to be able to use the stargazers-style badge:
image

@jongracecox
Copy link
Owner Author

This is similar to #43 in terms of embedding an image via URL(?), although the location would be fixed with this.

It would be nice to have pre-defined locations (e.g. left or right).

A basic first stab at the tasks:

  • Add logo_url argument to badge constructor.
  • Add logo_position argument (that would accept left or right)
  • Static variables to denote left or right (e.g. LOGO_POSITION_LEFT and LOGO_POSITION_RIGHT)
  • Command line arguments for url and position constructor args.
  • Add unit testing
  • Update documentation
  • Update repl.it

@jongracecox
Copy link
Owner Author

Images can be embedded into the SVG to make them self-contained using an image tag with xlink and a base64 encoding of the image.

<image width="100" height="100" xlink:href="data:image/png;base64,...">

@ahogen
Copy link

ahogen commented Sep 28, 2020

embedding an image via URL(?), although the location would be fixed with this

I really appreciate anybadge generating static SVGs. Part of its appeal to me over Shields.io (while awesome!) is that image is just loaded as-is. My project's CI job(s) will update badges with new content. Personal preference would be to avoid fetching the icon every time the image is loaded.

However, I do like pretty icons as well!

I notice that https://simpleicons.org/ provides (free?) SVGs. What if anybadge downloaded the requested icon and embedded it in the output SVG?

@eggplants
Copy link

+1

@jongracecox
Copy link
Owner Author

This site has a lot of examples: https://github.com/Naereen/badges Some include icons and embedded PNG images.

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

3 participants