fix(i18n): extract navigation links module and restore verbatim pt footer
CI / Lint e auditorias (push) Successful in 44s
CI / Trivy (dependências e segredos) (push) Successful in 9s
CI / Imagem Docker (linux/arm64) (push) Successful in 3m56s

- Move getLocalizedHref, LOCALES, and CANONICAL_ROUTES to i18n/links.js to resolve SSR 500 error on home
- Import from @/i18n/links in page.jsx, Header.jsx, Footer.jsx, and LanguageSelector.jsx
- Restore exact production footer texts, author links, and SVG icons in pt
- Verify 100% visible text parity on all pt pages against production with cmp-pt.py

Co-Authored-By: Antigravity <noreply@google.com>
This commit is contained in:
Lucas RayanandAntigravity committed 2026-11-01 10:19:22 -03:00
1 parent 02dee65b2b
commit dcd4ef7e1b
5 files changed
+170 -157

No files matched your search

+36 -31
View File
@@ -6,16 +6,16 @@ import Logo from "@/components/Logo";
import GiteaMark from "@/components/GiteaMark";
import { ArrowUpRight } from "lucide-react";
import { SITE } from "@/lib/seo";
import { LOCALES, getLocalizedHref } from "@/components/LanguageSelector";
import { LOCALES, getLocalizedHref } from "@/i18n/links";
const BASE_COLUMNS = [
const COLUMNS = [
{
title: "Explorar",
links: [
{ href: "/series", label: "Séries ESP32" },
{ href: "/comparacao", label: "Comparador" },
{ href: "/catalogo", label: "Catálogo de placas" },
{ href: "/livro", label: "O livro", livroOnly: true },
{ href: "/livro", label: "O livro" },
],
},
{
@@ -48,9 +48,9 @@ export default function Footer() {
const getLinkHref = (href) => getLocalizedHref(`/${currentLocale}${href}`, currentLocale);
const columns = BASE_COLUMNS.map((col) => ({
...col,
links: col.links.filter((l) => !l.livroOnly || isPt),
const columns = COLUMNS.map((column) => ({
...column,
links: column.links.filter((link) => link.href !== "/livro" || isPt),
}));
return (
@@ -139,40 +139,45 @@ export default function Footer() {
<br />
<span className="text-xs text-faint">Ciência Embarcada</span>
</p>
<div className="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm">
<a href={SITE.autorUrl} target="_blank" rel="noopener noreferrer" className="inline-flex min-h-11 items-center text-muted transition-colors hover:text-accent">
Site pessoal
<div className="mt-4 flex items-center gap-2">
<a
href={SITE.repositorio}
target="_blank"
rel="noopener noreferrer"
aria-label="Gitea do projeto (abre em nova aba)"
className="grid h-11 w-11 place-items-center rounded-full border border-line text-ink transition-colors hover:border-line-strong hover:bg-surface"
>
<GiteaMark className="h-4 w-4" />
</a>
<a href={SITE.autorLinkedin} target="_blank" rel="noopener noreferrer" className="inline-flex min-h-11 items-center text-muted transition-colors hover:text-accent">
LinkedIn
<a
href={SITE.autorLinkedin}
target="_blank"
rel="noopener noreferrer"
aria-label="LinkedIn do autor (abre em nova aba)"
className="grid h-11 w-11 place-items-center rounded-full border border-line text-ink transition-colors hover:border-line-strong hover:bg-surface"
>
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M4.98 3.5a2.5 2.5 0 1 1 0 5.001 2.5 2.5 0 0 1 0-5zM3 8.98h4v12H3v-12zm6.5 0h3.8v1.6h.1c.5-.9 1.8-1.9 3.6-1.9 3.8 0 4.5 2.5 4.5 5.8v6.5h-4v-5.8c0-1.4-.1-3.2-2-3.2-2 0-2.3 1.6-2.3 3.1v5.9h-4v-12z" />
</svg>
</a>
</div>
</div>
</div>
</div>
<div className="mt-12 flex flex-col items-center justify-between gap-4 border-t border-line pt-8 text-xs text-muted sm:flex-row">
<p>© {year} ESPDocs · Conteúdo sob licença MIT. Feito para a comunidade de sistemas embarcados.</p>
<div className="flex items-center gap-6">
<a
href={SITE.repositorio}
target="_blank"
rel="noopener noreferrer"
className="inline-flex min-h-11 items-center gap-1.5 transition-colors hover:text-accent"
>
<GiteaMark className="h-4 w-4" aria-hidden="true" />
<span>Gitea</span>
</a>
<span>·</span>
<a
href={SITE.blog}
target="_blank"
rel="noopener noreferrer"
className="inline-flex min-h-11 items-center transition-colors hover:text-accent"
>
<div className="mt-14 flex flex-col gap-4 border-t border-line pt-6 text-xs leading-relaxed text-faint md:flex-row md:items-center md:justify-between">
<p>© {year} ESPDocs. Projeto independente, sem afiliação com a Espressif Systems.</p>
<p className="flex flex-wrap items-center gap-x-5 gap-y-2">
<a href={SITE.blog} target="_blank" rel="noopener noreferrer" className="inline-flex min-h-11 items-center gap-1 transition-colors hover:text-accent">
Ciência Embarcada
<ArrowUpRight className="h-3 w-3" aria-hidden="true" />
</a>
</div>
<a href={SITE.autorUrl} target="_blank" rel="noopener noreferrer" className="inline-flex min-h-11 items-center gap-1 transition-colors hover:text-accent">
lucasrguerra.dev.br
<ArrowUpRight className="h-3 w-3" aria-hidden="true" />
</a>
<span>Fontes oficiais: Espressif Systems.</span>
</p>
</div>
</div>
</footer>