Skip to content

Support SVG badges as well as PNG #234

@mrchrisadams

Description

@mrchrisadams

We have an API end point for serving images, that looks like like the link below:

https://api.thegreenwebfoundation.org/greencheckimage/thegreenwebfoundation.org

This serves a PNG file so you can add it as a src tag:

green web badge

There is caching involved, but this an image generated using data from our database.

We've had someone folks request an SVG version of this as well, and this would be nice to add, as if we have a sample SVG we could render the same information into it, probably resulting in smaller file size too.

This would involve creating an SVG largely along the same lines as these blank template versions we currently use for creating bitmap images

https://github.com/thegreenwebfoundation/admin-portal/tree/master/apps/greencheck/badges

Implementing this

We don't really have the in- house experience to create an SVG file for this, but we would gladly accept pull requests that make it possible for people to request it, so for requests that look like the one below, we could serve the SVG file:

https://api.thegreenwebfoundation.org/greencheckimage/thegreenwebfoundation.org?type=svg

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions