Add static preview to some [GitHub] services (#2766)

This commit is contained in:
Paul Melnikow
2019-01-15 21:43:35 -05:00
committed by GitHub
parent 678359bdd6
commit 8a10279d95
10 changed files with 422 additions and 97 deletions

View File

@@ -26,6 +26,7 @@ class GithubCodeSize extends LegacyService {
static get route() {
return {
base: 'github/languages/code-size',
pattern: ':user/:repo',
}
}
@@ -33,8 +34,15 @@ class GithubCodeSize extends LegacyService {
return [
{
title: 'GitHub code size in bytes',
previewUrl: 'badges/shields',
keywords: ['GitHub', 'byte', 'code', 'size'],
namedParams: {
user: 'badges',
repo: 'shields',
},
staticPreview: {
label: 'code size',
message: '1.3 MB',
color: 'blue',
},
documentation,
},
]
@@ -51,6 +59,7 @@ class GithubLanguages extends LegacyService {
static get route() {
return {
base: 'github/languages',
pattern: ':which(top|count)/:user/:repo',
}
}
@@ -58,14 +67,30 @@ class GithubLanguages extends LegacyService {
return [
{
title: 'GitHub top language',
previewUrl: 'top/badges/shields',
keywords: ['GitHub', 'top', 'language'],
pattern: 'top/:user/:repo',
namedParams: {
user: 'badges',
repo: 'shields',
},
staticPreview: {
label: 'javascript',
message: '99.5%',
color: 'lightgrey',
},
documentation,
},
{
title: 'GitHub language count',
previewUrl: 'count/badges/shields',
keywords: ['GitHub', 'language', 'count'],
pattern: 'count/:user/:repo',
namedParams: {
user: 'badges',
repo: 'shields',
},
staticPreview: {
label: 'languages',
message: '5',
color: 'blue',
},
documentation,
},
]