Skip to content

Commit b0dc028

Browse files
feat: Implement blog and LaTeX post pages with dynamic routing and metadata generation
- Added blog post page with MDX support, reading time calculation, and navigation between posts. - Created a blog overview page displaying a welcome message and listing blog posts. - Developed LaTeX post page with similar features as the blog post page, including dynamic content rendering. - Introduced a course page for LaTeX tutorials, filtering relevant posts and displaying them in a sidebar. - Enhanced the main LaTeX page to differentiate between blog posts and course content. - Implemented internationalization support with language switcher and routing. - Added 404 error page with a user-friendly message and navigation options. - Updated layout and home page to include dynamic content and improved styling. - Created new MDX files for blog content in both English and Spanish. - Configured Next.js for static export and internationalization.
1 parent 96814ec commit b0dc028

28 files changed

Lines changed: 1110 additions & 484 deletions

File tree

app/(redirect)/layout.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// app/(redirect)/layout.js
2+
export default function RootLayout({ children }) {
3+
return (
4+
<html>
5+
<body>{children}</body>
6+
</html>
7+
);
8+
}

app/(redirect)/page.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// app/page.js
2+
"use client";
3+
import { useEffect } from "react";
4+
import { useRouter } from "next/navigation";
5+
6+
export default function RootPage() {
7+
const router = useRouter();
8+
9+
useEffect(() => {
10+
// Detección simple del navegador
11+
const userLang = navigator.language.startsWith("es") ? "es" : "en";
12+
console.log("Redirecting to locale:", userLang);
13+
router.replace(`/${userLang}`);
14+
}, [router]);
15+
16+
return (
17+
<div
18+
style={{
19+
display: "flex",
20+
justifyContent: "center",
21+
alignItems: "center",
22+
height: "100vh",
23+
gap: "20px",
24+
}}
25+
>
26+
<p>Redirecting...</p>
27+
{/* Opcional: Enlaces manuales por si falla JS */}
28+
<a href="/es">Español</a>
29+
<a href="/en">English</a>
30+
</div>
31+
);
32+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ShowPath from "@/app/components/showPath";
2-
import { MainBg } from "../../ui/ComponentsStyled";
2+
import { MainBg } from "../../../ui/ComponentsStyled";
33
import { Layout } from "@/app/ui/lugs";
44

55
const LicensePage = () => {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { MainBg } from "../ui/ComponentsStyled";
2+
import { MainBg } from "../../ui/ComponentsStyled";
33
import {
44
AboutMePanel,
55
AboutMeParaph,
@@ -8,9 +8,9 @@ import {
88
Layout,
99
LinkList,
1010
PhotoAvatar,
11-
} from "../ui/lugs";
11+
} from "../../ui/lugs";
1212
import Image from "next/image";
13-
import ShowPath from "../components/showPath";
13+
import ShowPath from "../../components/showPath";
1414

1515
const About = () => {
1616
return (
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
// import React from "react";
2-
import { MainPageBg, PageContainer, TitlePage } from "../ui/ComponentsStyled";
3-
import { getPostsByType } from "../lib/api";
2+
import {
3+
MainPageBg,
4+
PageContainer,
5+
TitlePage,
6+
} from "../../ui/ComponentsStyled";
7+
import { getPostsByType } from "../../lib/api";
48
import { notFound } from "next/navigation";
5-
import HomeBoxes from "../components/HomeBoxes";
6-
import { Layout } from "../ui/lugs";
9+
import HomeBoxes from "../../components/HomeBoxes";
10+
import { Layout } from "../../ui/lugs";
711
import {
812
MdParagraph,
913
MdListItem,
1014
MdUnorderedList,
11-
} from "../ui/MarkDownComponents";
12-
import ShowPath from "../components/showPath";
13-
import ScrollDiv from "../components/navigation/ScrollDiv";
15+
} from "../../ui/MarkDownComponents";
16+
import ShowPath from "../../components/showPath";
17+
import ScrollDiv from "../../components/navigation/ScrollDiv";
1418

1519
const BlogPage = () => {
1620
// const blogPosts = getBlogPosts();
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import {
22
MainPageBg,
33
PageContainer,
44
TitlePage,
5-
} from "../../ui/ComponentsStyled";
6-
import { getLatexPosts, getPostsByType } from "../../lib/api";
7-
import { Layout } from "../../ui/lugs";
8-
import HomeBoxes from "../../components/HomeBoxes";
9-
import ResponsiveSidebar from "../../components/SideBar";
5+
} from "../../../ui/ComponentsStyled";
6+
import { getLatexPosts, getPostsByType } from "../../../lib/api";
7+
import { Layout } from "../../../ui/lugs";
8+
import HomeBoxes from "../../../components/HomeBoxes";
9+
import ResponsiveSidebar from "../../../components/SideBar";
1010
import {
1111
MdListItem,
1212
MdParagraph,
1313
MdUnorderedList,
14-
} from "../../ui/MarkDownComponents";
14+
} from "../../../ui/MarkDownComponents";
1515
import ShowPath from "@/app/components/showPath";
1616

1717
const Latex = ({ params }) => {
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
import { MainPageBg, PageContainer, TitlePage } from "../ui/ComponentsStyled";
2-
import { getLatexPosts, getPostsByType } from "../lib/api";
3-
import { ButtonContainer, CopyButton, Layout } from "../ui/lugs";
4-
import HomeBoxes from "../components/HomeBoxes";
5-
import ResponsiveSidebar from "../components/SideBar";
1+
import {
2+
MainPageBg,
3+
PageContainer,
4+
TitlePage,
5+
} from "../../ui/ComponentsStyled";
6+
import { getLatexPosts, getPostsByType } from "../../lib/api";
7+
import { ButtonContainer, CopyButton, Layout } from "../../ui/lugs";
8+
import HomeBoxes from "../../components/HomeBoxes";
9+
import ResponsiveSidebar from "../../components/SideBar";
610
import {
711
MdHead,
812
MdListItem,
913
MdParagraph,
1014
MdSubHeadA,
1115
MdUnorderedList,
12-
} from "../ui/MarkDownComponents";
16+
} from "../../ui/MarkDownComponents";
1317
import Link from "next/link";
14-
import ShowPath from "../components/showPath";
15-
import ScrollDiv from "../components/navigation/ScrollDiv";
18+
import ShowPath from "../../components/showPath";
19+
import ScrollDiv from "../../components/navigation/ScrollDiv";
1620

1721
const Latex = ({ params }) => {
1822
// const AllLatexPosts = getLatexPosts();

0 commit comments

Comments
 (0)