Commit Graph

29 Commits

Author SHA1 Message Date
Thaddee Tyl
2f97be9118 Pre-compress badge templates with SVGO
Prior to this patch, time spend in badge.js (computing text width and
compressing the SVG with SVGO) averaged 8.4 ms.

After this patch, it clocks at 2.4 ms on average.

Assuming this is the CPU bottleneck, it means that servers used to only be able
to handle 119 req/s (empirically, it is closer to 100 req/s). It should now
handle 416 req/s (although a better guess is at 1/0.004 = 250 req/s).
2017-02-25 18:20:07 +01:00
Thaddee Tyl
38cf7a60b5 Use path.extname() to fetch template file name extension 2017-02-19 22:59:41 +01:00
Thaddee Tyl
2ba7ded391 Prioritize colorA/B over colorscheme colors
The wrong priority order was made in 29a4803e4b.
When a user enters ?colorB=007ec6, they want that color to override the default.
2017-01-08 17:21:35 +01:00
Thaddee Tyl
29a4803e4b Support combining colorA and colorscheme 2016-10-30 15:36:10 +01:00
Thaddee Tyl
b74107eb3d Stop using a link for default badge template
npm cannot handle links.
See https://github.com/npm/npm/issues/13884.
2016-09-08 23:23:43 +01:00
Thaddee Tyl
7ea0d811a5 Allow specifying a custom font path in the library 2016-09-07 07:24:58 +01:00
Thaddee Tyl
b72e29d793 Increase chances of pixel grid alignment 2016-03-13 23:55:06 +01:00
ForbesLindesay
e2fbb584c7 Use pdfkit instead of canvas 2015-07-21 11:31:27 +01:00
Thaddee Tyl
ca2bf2ea07 Capitalize social badges 2015-06-20 15:51:56 +02:00
Thaddee Tyl
75bc3cb90c Initial social button implementation 2015-05-08 23:58:42 +02:00
Thaddee Tyl
0d96e209e6 Remove logo padding if no left text
Part of #401
2015-04-25 16:03:55 +02:00
Thaddee Tyl
b1d3e00a21 Support for logos in flat design
Closes #401
Part of #337
2015-04-25 14:46:49 +02:00
Thaddee Tyl
dca2723b65 Ignore dot file templates 2015-04-22 23:27:27 +02:00
Thaddee Tyl
ecaf11a50e Prevent possible invalid colors.
They're only theoretical, but better safe than sad.
2014-11-19 09:40:30 +01:00
Thaddee Tyl
2e868d1e12 Coerce text to string.
Caused issues with numbers being .replace()'d.
2014-11-19 09:15:37 +01:00
Thaddee Tyl
b6a0970699 templates: escape invalid XML 2014-11-19 00:23:40 +01:00
Thaddee Tyl
ac9e1cb08c lib: preserve whitespace in templates 2014-10-25 19:15:38 +02:00
Jonathan Reinink
e69d52ae1c Add the ability to output badges as JSON. 2014-10-13 22:48:39 -04:00
Kazuki Suda
ed3a453026 Fix "no such file or directory" 2014-09-17 22:16:05 +09:00
Thaddee Tyl
a230e7c9c5 Allow invalid template styles. 2014-06-23 22:14:09 +02:00
Thaddee Tyl
2343e24d8a Load all templates through dot. 2014-04-20 16:12:35 +00:00
Thaddee Tyl
d578b65513 new flat style: cleanup.
- The information stored in `makeImage`'s `options` parameter is better served
  in its `data` parameter,
- Remove the (no longer used) `colorscheme` parameter to `makeTemplate`,
- We can already get to the contents of the URL query parameter `style` through
  that `data` parameter in `getRequest`,
- Relocation of the code to set badge data related to the flat style into
  `getBadgeData`,
- Code style (adding semicolons).

Related to issue #159.
2014-04-19 22:25:35 +00:00
Max Ogden
c6163c9a4f move colorscheme back to original location, add @ syntax to cli for specifying style, cache templates on server start 2014-04-19 10:27:20 -07:00
Max Ogden
f97fbf0dd0 add templates support and new flat style option 2014-04-19 01:11:06 -07:00
Thaddee Tyl
24f1bd6f0f Using __dirname 2014-01-18 18:57:03 +01:00
Thaddee Tyl
4f4cbf67a1 Font size increase.
Font order change.

Part of issue #14.
2014-01-14 11:37:40 +01:00
Thaddee Tyl
1b3f60ab8e Use local verdana file if available. 2014-01-04 13:34:13 +01:00
Thaddee Tyl
9bdbe595b9 Separate color scheme data in its own file. 2014-01-03 16:27:18 +01:00
Thaddee Tyl
3f906d533b Separate the SVG-generating logic. 2014-01-03 16:21:06 +01:00