Move build badge examples into services/ (#2234)
all-badge-examples is a common cause of merge conflicts. It’s difficult to adjust the badge categorization in that file – or to understand the diff – because it requires moving a block from one point to another. It’s much easier to edit a badge’s category in one place. This starts the process of breaking up what’s left of that file, following up on the work from #1931. New-style services can only be in one category, which means legacy service examples have to be split along category lines. I split out separate legacy service classes where I could do so easily, leaving behind the ones which require more work, for one reason or another.
This commit is contained in:
@@ -8,6 +8,41 @@ const {
|
||||
} = require('../../lib/color-formatters')
|
||||
|
||||
module.exports = class PackageControl extends LegacyService {
|
||||
static get category() {
|
||||
return 'downloads'
|
||||
}
|
||||
|
||||
static get url() {
|
||||
return {
|
||||
base: 'packagecontrol',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Package Control',
|
||||
previewUrl: 'dm/GitGutter',
|
||||
keywords: ['sublime'],
|
||||
},
|
||||
{
|
||||
title: 'Package Control',
|
||||
previewUrl: 'dw/GitGutter',
|
||||
keywords: ['sublime'],
|
||||
},
|
||||
{
|
||||
title: 'Package Control',
|
||||
previewUrl: 'dd/GitGutter',
|
||||
keywords: ['sublime'],
|
||||
},
|
||||
{
|
||||
title: 'Package Control',
|
||||
previewUrl: 'dt/GitGutter',
|
||||
keywords: ['sublime'],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static registerLegacyRouteHandler({ camp, cache }) {
|
||||
camp.route(
|
||||
/^\/packagecontrol\/(dm|dw|dd|dt)\/(.*)\.(svg|png|gif|jpg|json)$/,
|
||||
|
||||
Reference in New Issue
Block a user