igrigorik/ga-beacon — pull request #8 by sahat (2014-04-04 21:32:48+00:00)
Title: Added ga-beacon SVG Badge

Hi, I have created an SVG badge for ha-beacon similar to many others: NPM version, build status, dev dependencies.
It took a little time to get it right, text should be proportional to the width of the badge.
![screen shot 2014-04-04 at 5 20 31 pm](https://cloud.githubusercontent.com/assets/544954/2620534/f17a324e-bc3f-11e3-8820-f8f82dc07718.png)

Best of all this new badge looks good at any resolution, whereas `badge.gif` looks awful at normal resolution on retina displays.
![screen shot 2014-04-04 at 5 21 36 pm](https://cloud.githubusercontent.com/assets/544954/2620539/0d337d4c-bc40-11e3-86f9-346dbd413cbf.png)

I am not familiar with Google Go, so I couldn't update it to serve SVG instead of GIF. You have two choices, either one is acceptable:
1. Replace GIF with SVG completely.
2. Server SVG if you pass `?svg` flag:

```
var (
pixel = mustReadFile("static/pixel.gif")
badge = mustReadFile("static/badge.gif")
badgeSvg = mustReadFile("static/badge.svg")
pageTemplate = template.Must(template.New("page").ParseFiles("ga-beacon/page.html"))
)
```

and

```
query, _ := url.ParseQuery(r.URL.RawQuery)
if _, ok := query["pixel"]; ok {
w.Write(pixel)
} else if _, ok := query["svg"]; ok {
w.Write(badgeSvg)
} else {
w.Write(badge)
}
```