More example urls and static examples [apm waffle] (#2478)

This commit is contained in:
Paul Melnikow
2018-12-11 16:31:01 -05:00
committed by GitHub
parent d74568b9c9
commit 88c8b0ee3e
27 changed files with 289 additions and 82 deletions

View File

@@ -26,7 +26,13 @@ module.exports = class GithubCommitActivity extends LegacyService {
return [
{
title: 'GitHub commit activity the past week, 4 weeks, year',
previewUrl: 'y/eslint/eslint',
pattern: 'y/:user/:repo',
namedParams: { user: 'eslint', repo: 'eslint' },
staticPreview: {
label: 'commit activity',
message: '457/year',
color: 'blue',
},
keywords: ['GitHub', 'commit', 'commits', 'activity'],
documentation,
},

View File

@@ -22,8 +22,18 @@ module.exports = class GithubCommitStatus extends LegacyService {
return [
{
title: 'GitHub commit merge status',
previewUrl:
'badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c',
pattern: ':user/:repo/:branch/:commit',
namedParams: {
user: 'badges',
repo: 'shields',
branch: 'master',
commit: '5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c',
},
staticPreview: {
label: 'commits since 3.4.7',
message: '4225',
color: 'blue',
},
keywords: ['GitHub', 'commit', 'branch', 'merge'],
documentation,
},

View File

@@ -8,6 +8,8 @@ const {
} = require('../../lib/badge-data')
const { documentation } = require('./github-helpers')
const keywords = ['GitHub', 'commit']
module.exports = class GithubCommitsSince extends LegacyService {
static get category() {
return 'activity'
@@ -16,6 +18,7 @@ module.exports = class GithubCommitsSince extends LegacyService {
static get route() {
return {
base: 'github/commits-since',
pattern: ':user/:repo/:version',
}
}
@@ -23,14 +26,32 @@ module.exports = class GithubCommitsSince extends LegacyService {
return [
{
title: 'GitHub commits',
previewUrl: 'SubtitleEdit/subtitleedit/3.4.7',
keywords: ['GitHub', 'commit'],
namedParams: {
user: 'SubtitleEdit',
repo: 'subtitleedit',
version: '3.4.7',
},
staticPreview: {
label: 'commits since 3.4.7',
message: '4225',
color: 'blue',
},
keywords,
documentation,
},
{
title: 'GitHub commits (since latest release)',
previewUrl: 'SubtitleEdit/subtitleedit/latest',
keywords: ['GitHub', 'commit'],
namedParams: {
user: 'SubtitleEdit',
repo: 'subtitleedit',
version: 'latest',
},
staticPreview: {
label: 'commits since 3.5.7',
message: '157',
color: 'blue',
},
keywords,
documentation,
},
]

View File

@@ -26,7 +26,16 @@ module.exports = class GithubContributors extends LegacyService {
return [
{
title: 'GitHub contributors',
previewUrl: 'contributors/cdnjs/cdnjs',
pattern: 'contributors/:user/:repo',
namedParams: {
user: 'cdnjs',
repo: 'cdnjs',
},
staticPreview: {
label: 'contributors',
message: '397',
color: 'blue',
},
keywords: ['GitHub', 'contributor'],
documentation,
},

View File

@@ -26,38 +26,93 @@ module.exports = class GithubDownloads extends LegacyService {
return [
{
title: 'GitHub All Releases',
previewUrl: 'downloads/atom/atom/total',
keywords: ['github'],
pattern: 'downloads/:user/:repo/total',
namedParams: {
user: 'atom',
repo: 'atom',
},
staticPreview: {
label: 'downloads',
message: '857k total',
color: 'brightgreen',
},
documentation,
},
{
title: 'GitHub Releases',
previewUrl: 'downloads/atom/atom/latest/total',
keywords: ['github'],
pattern: 'downloads/:user/:repo/:tag/total',
namedParams: {
user: 'atom',
repo: 'atom',
tag: 'latest',
},
staticPreview: {
label: 'downloads',
message: '27k',
color: 'brightgreen',
},
documentation,
},
{
title: 'GitHub Pre-Releases',
previewUrl: 'downloads-pre/atom/atom/latest/total',
keywords: ['github'],
pattern: 'downloads-pre/:user/:repo/:tag/total',
namedParams: {
user: 'atom',
repo: 'atom',
tag: 'latest',
},
staticPreview: {
label: 'downloads',
message: '2k',
color: 'brightgreen',
},
documentation,
},
{
title: 'GitHub Releases (by Release)',
previewUrl: 'downloads/atom/atom/v0.190.0/total',
keywords: ['github'],
pattern: 'downloads/:user/:repo/:tag/total',
namedParams: {
user: 'atom',
repo: 'atom',
tag: 'v0.190.0',
},
staticPreview: {
label: 'downloads',
message: '490k v0.190.0',
color: 'brightgreen',
},
documentation,
},
{
title: 'GitHub Releases (by Asset)',
previewUrl: 'downloads/atom/atom/latest/atom-amd64.deb',
keywords: ['github'],
pattern: 'downloads/:user/:repo/:tag/:path*',
namedParams: {
user: 'atom',
repo: 'atom',
tag: 'latest',
path: 'atom-amd64.deb',
},
staticPreview: {
label: 'downloads',
message: '3k [atom-amd64.deb]',
color: 'brightgreen',
},
documentation,
},
{
title: 'GitHub Pre-Releases (by Asset)',
previewUrl: 'downloads-pre/atom/atom/latest/atom-amd64.deb',
keywords: ['github'],
pattern: 'downloads-pre/:user/:repo/:tag/:path*',
namedParams: {
user: 'atom',
repo: 'atom',
tag: 'latest',
path: 'atom-amd64.deb',
},
staticPreview: {
label: 'downloads',
message: '237 [atom-amd64.deb]',
color: 'brightgreen',
},
documentation,
},
]

View File

@@ -25,7 +25,17 @@ module.exports = class GithubFollowers extends LegacyService {
return [
{
title: 'GitHub followers',
pattern: ':user',
previewUrl: 'espadrine',
// https://github.com/badges/shields/issues/2479
// namedParams: {
// user: 'espadrine',
// },
// staticPreview: {
// label: 'Follow',
// message: '150',
// style: 'social',
// },
queryParams: { style: 'social', label: 'Follow' },
documentation,
},

View File

@@ -20,6 +20,7 @@ module.exports = class GithubLicense extends LegacyService {
static get route() {
return {
base: 'github/license',
pattern: ':user/:repo',
}
}
@@ -27,7 +28,12 @@ module.exports = class GithubLicense extends LegacyService {
return [
{
title: 'GitHub',
previewUrl: 'mashape/apistatus',
namedParams: { user: 'mashape', repo: 'apistatus' },
staticExample: {
label: 'license',
message: 'MIT',
color: 'green',
},
keywords: ['GitHub', 'license'],
documentation,
},