Skip to content

Commit 94e1c40

Browse files
committed
refactor(about): add contributors and resources
1 parent d1781db commit 94e1c40

File tree

16 files changed

+228
-63
lines changed

16 files changed

+228
-63
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Plugin } from 'vite'
2+
3+
let contributorsData: any[] = []
4+
5+
export function fetchContributors(): Plugin {
6+
return {
7+
name: 'fetch-contributors',
8+
async buildStart() {
9+
try {
10+
const response = await fetch('https://api.github.com/repos/GZTimeWalker/GZCTF/contributors')
11+
if (!response.ok) {
12+
console.warn('Failed to fetch contributors from GitHub')
13+
return
14+
}
15+
const contributors = (await response.json()) as any[]
16+
contributorsData = contributors
17+
.filter((c) => !c.login.includes('bot') && c.contributions > 1)
18+
.map((c: any) => ({
19+
login: c.login,
20+
html_url: c.html_url,
21+
avatar_url: c.avatar_url,
22+
contributions: c.contributions,
23+
}))
24+
console.log('Contributors data fetched')
25+
} catch (error) {
26+
console.warn('Error fetching contributors:', error)
27+
}
28+
},
29+
resolveId(id) {
30+
if (id === 'virtual:contributors') {
31+
return id
32+
}
33+
},
34+
load(id) {
35+
if (id === 'virtual:contributors') {
36+
return `export default ${JSON.stringify(contributorsData)}`
37+
}
38+
},
39+
}
40+
}

src/GZCTF/ClientApp/src/components/IconHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const IconHeader: FC<StickyHeaderProps> = ({ sticky, px }) => {
2626
>
2727
<LogoHeader />
2828
<Title className={classes.subtitle} order={3}>
29-
&gt; {config?.slogan ?? 'Hack for fun not for profit'}
29+
&gt;&nbsp;{config?.slogan ?? 'Hack for fun not for profit'}
3030
<Text span className={classes.blink}>
3131
_
3232
</Text>

src/GZCTF/ClientApp/src/locales/de-DE/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "Seite existiert nicht"
2020
},
2121
"about": {
22-
"slogan": "Hacke aus Spaß, nicht für Profit"
22+
"contributors": "Mitwirkende",
23+
"documentation": "Offizielle Dokumentation",
24+
"repository": "GitHub-Repository",
25+
"resources": "Ressourcen",
26+
"slogan": "Hacke aus Spaß, nicht für Profit",
27+
"version": "Version"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/en-US/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "Page does not exist"
2020
},
2121
"about": {
22-
"slogan": "Hack for fun not for profit"
22+
"contributors": "Contributors",
23+
"documentation": "Official Documentation",
24+
"repository": "GitHub Repository",
25+
"resources": "Resources",
26+
"slogan": "Hack for fun not for profit",
27+
"version": "Version"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/es-ES/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "La página no existe"
2020
},
2121
"about": {
22-
"slogan": "Hackea por diversión, sin ánimo de lucro"
22+
"contributors": "Contribuyentes",
23+
"documentation": "Documentación Oficial",
24+
"repository": "Repositorio GitHub",
25+
"resources": "Recursos",
26+
"slogan": "Hackea por diversión, sin ánimo de lucro",
27+
"version": "Versión"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/fr-FR/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "Page inexistante"
2020
},
2121
"about": {
22-
"slogan": "Hack for fun not for profit"
22+
"contributors": "Contributeurs",
23+
"documentation": "Documentation Officielle",
24+
"repository": "Dépôt GitHub",
25+
"resources": "Ressources",
26+
"slogan": "Hack for fun not for profit",
27+
"version": "Version"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/id-ID/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "Halaman tidak ada"
2020
},
2121
"about": {
22-
"slogan": "Ngehack untuk senang senang bukan buat nyari profit"
22+
"contributors": "Kontributor",
23+
"documentation": "Dokumentasi Resmi",
24+
"repository": "Repositori GitHub",
25+
"resources": "Sumber Daya",
26+
"slogan": "Ngehack untuk senang senang bukan buat nyari profit",
27+
"version": "Versi"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/ja-JP/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "ページが存在しません"
2020
},
2121
"about": {
22-
"slogan": "Hack for fun not for profit"
22+
"contributors": "貢献者",
23+
"documentation": "公式ドキュメント",
24+
"repository": "GitHub リポジトリ",
25+
"resources": "リソース",
26+
"slogan": "Hack for fun not for profit",
27+
"version": "バージョン"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/ko-KR/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "페이지가 존재하지 않습니다"
2020
},
2121
"about": {
22-
"slogan": "수익이 아니라 재미를 위해 해킹을 하세요!"
22+
"contributors": "기여자",
23+
"documentation": "공식 문서",
24+
"repository": "GitHub 저장소",
25+
"resources": "리소스",
26+
"slogan": "수익이 아니라 재미를 위해 해킹을 하세요!",
27+
"version": "버전"
2328
},
2429
"color": {
2530
"custom": {

src/GZCTF/ClientApp/src/locales/ru-RU/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
"title": "Страница не существует"
2020
},
2121
"about": {
22-
"slogan": "Играй в удовольствие, а не ради денег"
22+
"contributors": "Участники",
23+
"documentation": "Официальная документация",
24+
"repository": "GitHub репозиторий",
25+
"resources": "Ресурсы",
26+
"slogan": "Играй в удовольствие, а не ради денег",
27+
"version": "Версия"
2328
},
2429
"color": {
2530
"custom": {

0 commit comments

Comments
 (0)