kopia lustrzana https://github.com/badgen/badgen.net
Support labelColor (resolve #281)
rodzic
0e36a5debb
commit
6ab1d524fa
|
@ -32,6 +32,11 @@ export default ({ isFlat }) => (
|
|||
Override default subject text (<a href='https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding'>URL-Encoding</a> needed for spaces or special characters).
|
||||
<a href='/badge/docker/v1.2.3/blue?icon=docker'>e.g.</a>
|
||||
</li>
|
||||
<li>
|
||||
<code>labelColor</code>
|
||||
Override default label color.
|
||||
<a href='/npm/dm/express?labelColor=pink'>e.g.</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Advanced usage</h3>
|
||||
|
|
|
@ -14,13 +14,14 @@ export default function (req, res, options: ServeBadgeOptions) {
|
|||
const { code = 200, sMaxAge = 10800, query = {}, params } = options
|
||||
|
||||
const { subject, status, color } = params
|
||||
const { label, list, icon, iconWidth } = query
|
||||
const { label, labelColor, icon, iconWidth, list } = query
|
||||
const _icon = resolveIcon(icon, iconWidth)
|
||||
|
||||
// TODO: review usage of list
|
||||
list && console.log(`FEAT-LIST ${req.url}`)
|
||||
|
||||
const badge = badgen({
|
||||
labelColor,
|
||||
subject: typeof label !== 'undefined' ? label : subject,
|
||||
status: transformStatus(status, { list }),
|
||||
color: query.color || color,
|
||||
|
|
Ładowanie…
Reference in New Issue