Skip to content

Commit

Permalink
feat: migrate /liberapay (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
amio authored Jul 9, 2024
1 parent c0f8ac2 commit b58e0de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion libs/badge-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const liveBadgeList = [
'mastodon',
'tidelift',
'jenkins',
'liberapay',
]

export async function loadBadgeMeta() {
Expand Down
4 changes: 3 additions & 1 deletion libs/badge-list2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import matrix from '../pages/api/matrix'
import runkit from '../pages/api/runkit'
import winget from '../pages/api/winget'
import xo from '../pages/api/xo'
import liberapay from 'pages/api/liberapay'

export default {
static: staticBadge.meta,
Expand Down Expand Up @@ -55,5 +56,6 @@ export default {
discord: discord.meta,
matrix: matrix.meta,
runkit: runkit.meta,
xo: xo.meta
xo: xo.meta,
liberapay: liberapay.meta,
}
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const nextConfig = {
'/matrix',
'/runkit',
'/peertube',
// utilities
'/liberapay',
// discontinued
'/apm',
'/lgtm',
Expand Down
10 changes: 8 additions & 2 deletions api-legacy/liberapay.ts → pages/api/liberapay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import got from '../libs/got'
import { createBadgenHandler, PathArgs } from '../libs/create-badgen-handler'
import got from '../../libs/got'
import { createBadgenHandler, PathArgs } from '../../libs/create-badgen-handler-next'

export default createBadgenHandler({
title: 'Liberapay',
Expand Down Expand Up @@ -61,5 +61,11 @@ async function handler ({ topic, slug }: PathArgs) {
status: goal,
color: goal !== 'not set' ? 'yellow' : 'grey'
}
default:
return {
subject: 'liberapay',
status: 'unknown',
color: 'grey'
}
}
}

0 comments on commit b58e0de

Please sign in to comment.