PaiGramDocs/docs/contributors.ts

32 lines
701 B
TypeScript
Raw Normal View History

2023-10-20 17:15:41 +00:00
import contributors from './contributors.json'
export interface Contributor {
name: string
avatar: string
}
export interface CoreTeam {
avatar: string
name: string
github: string
twitter?: string
sponsors?: boolean
description: string
packages?: string[]
functions?: string[]
}
const contributorsAvatars: Record<string, string> = {}
function getAvatarUrl(name: string) {
return `https://github.com/${name}.png`
}
const contributorList = (contributors as string[]).reduce((acc, name) => {
contributorsAvatars[name] = getAvatarUrl(name)
acc.push({ name, avatar: contributorsAvatars[name] })
return acc
}, [] as Contributor[])
export { contributorList as contributors }