URL format change, to prepare for future possibilities.
This commit is contained in:
parent
16da2eee02
commit
ec4326381c
|
@ -19,7 +19,7 @@ function escapeFormat(t) {
|
|||
|
||||
function sixHex(s) { return /^[0-9a-fA-F]{6}$/.test(s); }
|
||||
|
||||
camp.route(/^\/(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+).(svg|png|gif|jpg|pdf)$/,
|
||||
camp.route(/^\/:(([^-]|--)+)-(([^-]|--)+)-(([^-]|--)+).(svg|png|gif|jpg|pdf)$/,
|
||||
function(data, match, end, ask) {
|
||||
var subject = escapeFormat(match[1]);
|
||||
var status = escapeFormat(match[3]);
|
||||
|
|
|
@ -29,8 +29,8 @@ h2 { font-variant: small-caps; }
|
|||
|
||||
<h2>GitHub Badges</h2>
|
||||
|
||||
<img src='/badge-on!-brightgreen.svg'>
|
||||
<img src='/license-CC0-red.svg'>
|
||||
<img src='/:badge-on!-brightgreen.svg'>
|
||||
<img src='/:license-CC0-red.svg'>
|
||||
|
||||
<p>
|
||||
Ever wanted to have your own GitHub badges? <br/>
|
||||
|
@ -41,7 +41,7 @@ Maybe you simply love SVG. <br/>
|
|||
Maybe you fancy a format that uses less than half the bandwidth.
|
||||
</p>
|
||||
|
||||
<img src='/happy-hacking%20%E2%98%BA-yellow.svg'>
|
||||
<img src='/:happy-hacking%20%E2%98%BA-yellow.svg'>
|
||||
|
||||
<p>
|
||||
As for me, I wanted a format that people can reuse and hack on. <br/>
|
||||
|
@ -49,26 +49,26 @@ I wanted a service for everyone. <br/>
|
|||
I made the GitHub Badge Service.
|
||||
</p>
|
||||
|
||||
<img src='/download-.5K-blue.svg'>
|
||||
<img src='/:download-.5K-blue.svg'>
|
||||
|
||||
<p>
|
||||
Here's how it works. <br/>
|
||||
<code>http://gh-badges.herokuapp.com/<SUBJECT>-<STATUS>-<COLOR>.svg</code><br/>
|
||||
<code>http://gh-badges.herokuapp.com/:<SUBJECT>-<STATUS>-<COLOR>.svg</code><br/>
|
||||
Use two dashes <code>--</code> to have one dash as text. <br/>
|
||||
Use two underscores <code>__</code> to have one underscore as text. <br/>
|
||||
Use an underscore <code>_</code> if you want a space. Or, you know, use a space.
|
||||
</p>
|
||||
|
||||
<p> Colors: </p>
|
||||
<img src='/color-brightgreen-brightgreen.svg'>
|
||||
<img src='/color-green-green.svg'>
|
||||
<img src='/color-yellowgreen-yellowgreen.svg'>
|
||||
<img src='/color-yellow-yellow.svg'>
|
||||
<img src='/color-orange-orange.svg'>
|
||||
<img src='/color-red-red.svg'>
|
||||
<img src='/color-lightgrey-lightgrey.svg'>
|
||||
<img src='/color-blue-blue.svg'>
|
||||
<img src='/color-ff69b4-ff69b4.svg'>
|
||||
<img src='/:color-brightgreen-brightgreen.svg'>
|
||||
<img src='/:color-green-green.svg'>
|
||||
<img src='/:color-yellowgreen-yellowgreen.svg'>
|
||||
<img src='/:color-yellow-yellow.svg'>
|
||||
<img src='/:color-orange-orange.svg'>
|
||||
<img src='/:color-red-red.svg'>
|
||||
<img src='/:color-lightgrey-lightgrey.svg'>
|
||||
<img src='/:color-blue-blue.svg'>
|
||||
<img src='/:color-ff69b4-ff69b4.svg'>
|
||||
|
||||
<h2>Like This?</h2>
|
||||
|
||||
|
@ -119,7 +119,7 @@ function escapeField(s) {
|
|||
return s.replace(/-/g, '--').replace(/_/g, '__');
|
||||
}
|
||||
function makeImage() {
|
||||
var url = '/';
|
||||
var url = '/:';
|
||||
url += escapeField(imageMaker.subject.value);
|
||||
url += '-' + escapeField(imageMaker.status.value);
|
||||
url += '-' + escapeField(imageMaker.color.value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user