Comment

Comment by cuu508

I went more minimalistic and added SVG badge support in the form of a Django template and a couple small python functions.

The template: https://raw.githubusercontent.com/healthchecks/healthchecks/...

And the function for rendering the template: https://github.com/healthchecks/healthchecks/blob/master/hc/...

One funky thing there is the measurement of text width. The width of the badge depends of the width of the text you put into it. I simply measured the width of each individual alphabet letter, and use that to calculate the width of a string. It's not super accurate, but works fine in practice. It was a fun weekend project.

parent cuu508 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton