Skip to content

Commit 29baf16

Browse files
Refactor metadata handling and improve localization: update image URLs and titles in various components; enhance NotFound page with bilingual support and improved styling
1 parent 44f20b8 commit 29baf16

11 files changed

Lines changed: 244 additions & 99 deletions

File tree

app/[locale]/about/license/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const LicensePage = () => {
99
return (
1010
<Layout>
1111
<MainBg>
12-
<ShowPath title={"licence"} />
12+
<ShowPath title={"license"} />
1313
<h1>{t("license_title")}</h1>
1414
<p>{t("license_terms")}</p>
1515
</MainBg>

app/[locale]/about/page.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export async function generateMetadata({ params }) {
147147
siteName: "Eric Lucero González",
148148
images: [
149149
{
150-
url: "https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
150+
url: t("thumbnailImage"),
151151
width: 1200,
152152
height: 630,
153153
alt: t("description"), // Texto alternativo traducido
@@ -160,8 +160,7 @@ export async function generateMetadata({ params }) {
160160
card: "summary_large_image",
161161
title: t("title"),
162162
description: t("description"),
163-
image:
164-
"https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
163+
image: t("thumbnailImage"),
165164
},
166165
};
167166
}

app/[locale]/blog/[slug]/page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import rehypeMathjax from "rehype-mathjax";
2828
import supersub from "remark-supersub";
2929
import rehypeHighlight from "rehype-highlight";
3030
import { getTranslations, setRequestLocale } from "next-intl/server";
31+
import { notFound } from "next/navigation";
3132

3233
const BlogPost = async ({ params }) => {
3334
const { locale, slug } = await params;

app/[locale]/blog/page.js

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "../../ui/MarkDownComponents";
1616
import ShowPath from "../../components/showPath";
1717
import ScrollDiv from "../../components/navigation/ScrollDiv";
18-
import { setRequestLocale } from "next-intl/server";
18+
import { getTranslations, setRequestLocale } from "next-intl/server";
1919
import BackgroundDots from "@/app/components/BgMovingDots";
2020

2121
const BlogPage = async ({ params }) => {
@@ -70,29 +70,46 @@ const BlogPage = async ({ params }) => {
7070

7171
export default BlogPage;
7272

73-
export const metadata = {
74-
title: "Blog | Eric Lucero González",
75-
description:
76-
"Explora artículos sobre Inteligencia Artificial, programación, algoritmos metaheurísticos y más. Comparte mi viaje académico y profesional.",
77-
openGraph: {
78-
title: "Eric's Blog - Inteligencia Artificial y más",
79-
description:
80-
"Artículos y reflexiones sobre IA, optimización, programación y mi proceso de aprendizaje durante el doctorado.",
81-
images: [
82-
{
83-
url: "https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png", // Imagen relacionada con el blog
84-
width: 1200,
85-
height: 630,
86-
alt: "Blog sobre Inteligencia Artificial y programación",
73+
export async function generateMetadata({ params }) {
74+
const { locale } = await params;
75+
76+
// Obtenemos las traducciones del servidor para la sección "Metadata"
77+
const t = await getTranslations({ locale, namespace: "Metadata" });
78+
const URLbase = "https://ericlucerogonzalez.github.io";
79+
80+
return {
81+
title: t("defaultTitle"),
82+
description: t("description"),
83+
keywords: t("keywords"),
84+
// Configuración vital para SEO Multilingüe
85+
alternates: {
86+
canonical: `${URLbase}/${locale}`,
87+
languages: {
88+
es: `${URLbase}/es`,
89+
en: `${URLbase}/en`,
8790
},
88-
],
89-
},
90-
twitter: {
91-
card: "summary_large_image",
92-
title: "Eric's Blog - Inteligencia Artificial y más",
93-
description:
94-
"Artículos y reflexiones sobre IA, optimización y programación.",
95-
image:
96-
"https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
97-
},
98-
};
91+
},
92+
openGraph: {
93+
title: t("defaultTitle"),
94+
description: t("description"),
95+
url: `${URLbase}/${locale}`, // URL canónica para compartir
96+
siteName: "Eric Lucero González",
97+
images: [
98+
{
99+
url: t("thumbnailImage"),
100+
width: 1200,
101+
height: 630,
102+
alt: t("defaultTitle"), // Texto alternativo traducido
103+
},
104+
],
105+
locale: locale,
106+
type: "website",
107+
},
108+
twitter: {
109+
card: "summary_large_image",
110+
title: t("defaultTitle"),
111+
description: t("description"),
112+
image: t("thumbnailImage"),
113+
},
114+
};
115+
}

app/[locale]/layout.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,26 @@ export async function generateMetadata({ params }) {
3535
},
3636
},
3737
openGraph: {
38-
title: t("templateTitle"),
38+
title: t("defaultTitle"),
3939
description: t("description"),
4040
url: `${URLbase}/${locale}`, // URL canónica para compartir
4141
siteName: "Eric Lucero González",
4242
images: [
4343
{
44-
url: "https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
44+
url: t("thumbnailImage"),
4545
width: 1200,
4646
height: 630,
47-
alt: t("templateTitle"), // Texto alternativo traducido
47+
alt: t("defaultTitle"), // Texto alternativo traducido
4848
},
4949
],
5050
locale: locale,
5151
type: "website",
5252
},
5353
twitter: {
5454
card: "summary_large_image",
55-
title: t("templateTitle"),
55+
title: t("defaultTitle"),
5656
description: t("description"),
57-
image:
58-
"https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
57+
image: t("thumbnailImage"),
5958
},
6059
};
6160
}

app/[locale]/not-found.js

Lines changed: 97 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,106 @@
1-
import Link from "next/link";
2-
import { Main, NotFoundText, NotFoundTitle } from "../ui/ComponentsStyled";
3-
import Image from "next/image";
1+
import { useTranslations } from "next-intl";
42

3+
import { Layout, MainBg } from "../ui/lugs"; // Tus componentes de estilo
4+
import { Link } from "@/i18n/navigation";
5+
6+
// Nota: Este archivo hereda automáticamente el layout de [locale],
7+
// así que ya tendrá Navbar y Footer.
58
export default function NotFound() {
9+
const t = useTranslations("NotFound");
10+
611
return (
7-
<Main
8-
style={{
9-
backgroundColor: "white",
10-
}}
11-
>
12-
<div
13-
style={{
14-
display: "flex",
15-
flexDirection: "column",
16-
justifyContent: "space-between",
17-
color: "#6C63FF",
18-
margin: "20px auto",
19-
alignItems: "center",
20-
fontFamily: "monospace",
21-
}}
22-
>
23-
<NotFoundTitle>Error 404:</NotFoundTitle>
24-
<h2>Dirección no encontrada.</h2>
12+
<Layout>
13+
<MainBg>
14+
<div
15+
style={{
16+
display: "flex",
17+
flexDirection: "column",
18+
alignItems: "center",
19+
justifyContent: "center",
20+
minHeight: "60vh",
21+
textAlign: "center",
22+
gap: "20px",
23+
}}
24+
>
25+
<h1
26+
style={{
27+
fontSize: "4rem",
28+
fontWeight: "bold",
29+
color: "var(--accent)",
30+
}}
31+
>
32+
404
33+
</h1>
34+
<h2 style={{ fontSize: "2rem" }}>{t("title")}</h2>
35+
<p>{t("description")}</p>
2536

26-
<div style={{ maxWidth: "70%" }}>
27-
<Image
28-
src={
29-
"https://res.cloudinary.com/dcvnw6hvt/image/upload/v1739964161/elCronopio/404_bw_cli0yg.png"
30-
} // Ruta de la imagen del autor
31-
alt={"Un ovni llevándose a los usuarios de la pagina no encontrada"} // Texto alternativo
32-
width={180} // Ancho de la imagen
33-
height={180} // Alto de la imagen
34-
// priority
35-
// placeholder="blur"
36-
// Make the image display full width
37+
<Link
38+
href="/"
3739
style={{
38-
width: "100%",
39-
height: "auto",
40+
padding: "10px 20px",
41+
backgroundColor: "var(--primary-btn-bg)",
42+
color: "white",
43+
borderRadius: "5px",
44+
textDecoration: "none",
45+
marginTop: "20px",
4046
}}
41-
/>
47+
>
48+
{t("backHome")}
49+
</Link>
4250
</div>
43-
<NotFoundText>
44-
La dirección que has colocado no ha sido creada todavía. Verifica que
45-
la hayas escrito bien, o vuelve a la página principal.
46-
</NotFoundText>
47-
<Link href="/">Regresar</Link>
48-
{/* https://res.cloudinary.com/dcvnw6hvt/image/upload/v1739809759/elCronopio/xle8npibijpsgk9qkfnd.png */}
49-
</div>
50-
</Main>
51+
</MainBg>
52+
</Layout>
5153
);
5254
}
55+
// import Link from "next/link";
56+
// import { Main, NotFoundText, NotFoundTitle } from "../ui/ComponentsStyled";
57+
// import Image from "next/image";
58+
59+
// export default function NotFound() {
60+
// return (
61+
// <Main
62+
// style={{
63+
// backgroundColor: "white",
64+
// }}
65+
// >
66+
// <div
67+
// style={{
68+
// display: "flex",
69+
// flexDirection: "column",
70+
// justifyContent: "space-between",
71+
// color: "#6C63FF",
72+
// margin: "20px auto",
73+
// alignItems: "center",
74+
// fontFamily: "monospace",
75+
// }}
76+
// >
77+
// <NotFoundTitle>Error 404:</NotFoundTitle>
78+
// <h2>Dirección no encontrada.</h2>
79+
80+
// <div style={{ maxWidth: "70%" }}>
81+
// <Image
82+
// src={
83+
// "https://res.cloudinary.com/dcvnw6hvt/image/upload/v1739964161/elCronopio/404_bw_cli0yg.png"
84+
// } // Ruta de la imagen del autor
85+
// alt={"Un ovni llevándose a los usuarios de la pagina no encontrada"} // Texto alternativo
86+
// width={180} // Ancho de la imagen
87+
// height={180} // Alto de la imagen
88+
// // priority
89+
// // placeholder="blur"
90+
// // Make the image display full width
91+
// style={{
92+
// width: "100%",
93+
// height: "auto",
94+
// }}
95+
// />
96+
// </div>
97+
// <NotFoundText>
98+
// La dirección que has colocado no ha sido creada todavía. Verifica que
99+
// la hayas escrito bien, o vuelve a la página principal.
100+
// </NotFoundText>
101+
// <Link href="/">Regresar</Link>
102+
// {/* https://res.cloudinary.com/dcvnw6hvt/image/upload/v1739809759/elCronopio/xle8npibijpsgk9qkfnd.png */}
103+
// </div>
104+
// </Main>
105+
// );
106+
// }

app/[locale]/page.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,26 @@ export async function generateMetadata({ params }) {
9494
},
9595
},
9696
openGraph: {
97-
title: t("templateTitle"),
97+
title: t("defaultTitle"),
9898
description: t("description"),
9999
url: `${URLbase}/${locale}`, // URL canónica para compartir
100100
siteName: "Eric Lucero González",
101101
images: [
102102
{
103-
url: "https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
103+
url: t("thumbnailImage"),
104104
width: 1200,
105105
height: 630,
106-
alt: t("templateTitle"), // Texto alternativo traducido
106+
alt: t("defaultTitle"), // Texto alternativo traducido
107107
},
108108
],
109109
locale: locale,
110110
type: "website",
111111
},
112112
twitter: {
113113
card: "summary_large_image",
114-
title: t("templateTitle"),
114+
title: t("defaultTitle"),
115115
description: t("description"),
116-
image:
117-
"https://res.cloudinary.com/dcvnw6hvt/image/upload/v1732970163/elCronopio/elcronopio_eewxj0.png",
116+
image: t("thumbnailImage"),
118117
},
119118
};
120119
}

app/components/navigation/footer/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { useTranslations } from "next-intl";
44
// import Link from "next/link";
55
import React from "react";
66
import { Link } from "@/i18n/navigation";
7-
import { FaCreativeCommons, FaInfoCircle } from "react-icons/fa";
7+
import { FaCreativeCommons, FaInfoCircle, FaReact } from "react-icons/fa";
88
import styled from "styled-components";
9+
import { SiI18Next, SiNextdotjs } from "react-icons/si";
10+
import { IoLogoJavascript } from "react-icons/io5";
911

1012
const FooterContainer = styled.footer`
1113
/* width: 100%; */
@@ -39,7 +41,7 @@ const FooterTextBox = styled.div`
3941
flex-direction: column;
4042
`;
4143
const FooterText = styled.p`
42-
font-size: 1rem;
44+
font-size: smaller;
4345
/* border: 1px solid red; */
4446
`;
4547
const FoooterLink = styled.a`
@@ -126,8 +128,10 @@ const Footer = () => {
126128
&copy; {new Date().getFullYear()} Eric Lucero González.
127129
</FooterText>
128130
{/* <FooterText>All Rights Reserved</FooterText> */}
129-
<FooterText>
130-
{t("made_with")}
131+
<FooterText style={{ marginTop: "1rem" }}>
132+
{t("made_with")}{" "}
133+
</FooterText>
134+
<FooterText style={{ fontSize: "large" }}>
131135
<svg
132136
xmlns="http://www.w3.org/2000/svg"
133137
viewBox="0 0 512 512"
@@ -136,7 +140,8 @@ const Footer = () => {
136140
fill="var(--accent)"
137141
>
138142
<path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z" />
139-
</svg>
143+
</svg>{" "}
144+
<IoLogoJavascript /> <FaReact /> <SiNextdotjs /> <SiI18Next />
140145
</FooterText>
141146
</FooterTextBox>
142147
<FooterTextBox>

0 commit comments

Comments
 (0)