theodi/open-data-certificate — pull request #445 by pezholio (2013-08-02 10:51:37+00:00)
Title: Change badge code

This PR now means people can use one line of JS to add their badge code. The actual badge images themselves can now be served like so:

https://certificates.theodi.org/datasets/506/certificates/12197/badge.png

The JS will be available at

https://certificates.theodi.org/datasets/506/certificates/12197/badge.js

I've also done a small refactor to pull the documentation URL into a Dataset, via a new `meta_map` attribute, which includes the `dataset_title` and `dataset_curator` mappings (as discussed with @benfoxall). This means users can include JS in this format to get a badge for a specific dataset:

If the `datasetUrl` is left out, the script attempts to get a badge from the referring page (which will be where the JS in included).