diff --git a/web/app/changelog/page.tsx b/web/app/changelog/page.tsx index ffeb972..016ba53 100644 --- a/web/app/changelog/page.tsx +++ b/web/app/changelog/page.tsx @@ -2,7 +2,7 @@ import fs from "fs" import path from "path" import { remark } from "remark" import html from "remark-html" -import gfm from "remark-gfm" // 🔹 Agregamos soporte para imágenes y tablas +import gfm from "remark-gfm" // 🔹 Agregamos soporte para imágenes, tablas y enlaces automáticos import dynamic from "next/dynamic" import React from "react" import parse from "html-react-parser" @@ -10,16 +10,16 @@ import parse from "html-react-parser" // 🔹 Importamos `CopyableCode` dinámicamente para evitar problemas de SSR const CopyableCode = dynamic(() => import("@/components/CopyableCode"), { ssr: false }) -async function getGuideContent(slug: string) { +async function getChangelogContent() { try { - const guidePath = path.join(process.cwd(), "..", "guides", `${slug}.md`) - const fileContents = fs.readFileSync(guidePath, "utf8") + const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md") + const fileContents = fs.readFileSync(changelogPath, "utf8") const result = await remark().use(gfm).use(html).process(fileContents) // 🔹 Se añade `remark-gfm` return result.toString() } catch (error) { - console.error(`❌ Error al leer el archivo: ${slug}.md`, error) - return "

Error: No se pudo cargar el contenido de la guía.

" + console.error("❌ Error al leer el archivo CHANGELOG.md", error) + return "

Error: No se pudo cargar el contenido del changelog.

" } } @@ -45,14 +45,15 @@ function wrapCodeBlocksWithCopyable(content: string) { }) } -export default async function GuidePage({ params }: { params: { slug: string } }) { - const guideContent = await getGuideContent(params.slug) - const cleanedInlineCode = cleanInlineCode(guideContent) // 🔹 Primero limpiamos código en línea +export default async function ChangelogPage() { + const changelogContent = await getChangelogContent() + const cleanedInlineCode = cleanInlineCode(changelogContent) // 🔹 Primero limpiamos código en línea const parsedContent = wrapCodeBlocksWithCopyable(cleanedInlineCode) // 🔹 Luego aplicamos JSX a bloques de código return (
-
+
{/* 📌 Ajuste exacto como GitHub */} +

Changelog

{parsedContent}
{/* 📌 Ahora con imágenes */}