feat: use Forgejo stars API instead of GitHub

This commit is contained in:
WildDragon Deploy 2026-05-27 23:36:19 -04:00
parent b3ec0c9695
commit e4da2ef485

View file

@ -38,10 +38,11 @@ export const useGitHubStars = (owner: string, repo: string) => {
const fetchStars = async () => { const fetchStars = async () => {
try { try {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`); const baseUrl = import.meta.env.VITE_FORGEJO_BASE_URL || 'https://forge.wilddragon.net';
const response = await fetch(`${baseUrl}/api/v1/repos/${owner}/${repo}`);
if (!response.ok) return; if (!response.ok) return;
const data = await response.json(); const data = await response.json();
const count = data.stargazers_count; const count = data.stars_count;
if (typeof count === 'number') { if (typeof count === 'number') {
setStarCount(count); setStarCount(count);
try { try {