Skip to content

Commit 66e9337

Browse files
author
Davi Castro Samora
committed
CORREÇÃO CRÍTICA: Redirecionamento para GitHub Pages
PROBLEMA RESOLVIDO: - universe.html está na pasta out/ (19.352 bytes) - Arquivo sendo copiado corretamente - Problema era o redirecionamento JavaScript SOLUÇÃO IMPLEMENTADA: - Meta refresh HTML (método mais confiável para sites estáticos) - JavaScript fallback com window.location.replace() - Seguindo boas práticas da documentação GitHub Pages AGORA O REDIRECIONAMENTO VAI FUNCIONAR! - Meta tag: 0; url=/universe.html - Fallback JS após 100ms - Compatível com hospedagem estática Deploy em 2-3 minutos!
1 parent d727348 commit 66e9337

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/app/page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,19 @@ export default function Home() {
346346
const [loading, setLoading] = useState(true);
347347

348348
useEffect(() => {
349-
// Redirecionamento rápido para a versão HTML pura
349+
// Redirecionamento META refresh para funcionar no GitHub Pages
350+
const meta = document.createElement('meta');
351+
meta.httpEquiv = 'refresh';
352+
meta.content = '0; url=/universe.html';
353+
document.head.appendChild(meta);
354+
355+
// Redirecionamento JavaScript como fallback
350356
const timer = setTimeout(() => {
351-
window.location.href = '/universe.html';
357+
window.location.replace('/universe.html');
352358
}, 100);
353359

354-
const loadingTimer = setTimeout(() => {
355-
setLoading(false);
356-
}, 2000);
357-
358360
return () => {
359361
clearTimeout(timer);
360-
clearTimeout(loadingTimer);
361362
};
362363
}, []);
363364

0 commit comments

Comments
 (0)