34 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-02-13 23:04:40 +01:00
import fs from "fs"
import path from "path"
2025-02-14 18:11:45 +01:00
2025-02-13 23:04:40 +01:00
async function getChangelog() {
2025-02-14 17:31:44 +01:00
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
2025-02-14 17:54:52 +01:00
try {
const fileContents = fs.readFileSync(changelogPath, "utf8")
2025-02-14 19:21:23 +01:00
2025-02-14 19:27:05 +01:00
// Asegurar que el contenido no tiene espacios innecesarios
2025-02-14 19:21:23 +01:00
return fileContents.trim()
2025-02-14 17:54:52 +01:00
} catch (error) {
console.error("Error reading changelog file:", error)
2025-02-14 19:09:50 +01:00
return "<p>Changelog content not found.</p>"
2025-02-14 17:54:52 +01:00
}
2025-02-13 23:04:40 +01:00
}
export default async function ChangelogPage() {
const changelogContent = await getChangelog()
2025-02-14 12:24:18 +01:00
return (
2025-02-14 18:21:58 +01:00
<div className="bg-white text-gray-900 min-h-screen">
2025-02-14 17:54:52 +01:00
<div className="container mx-auto px-4 py-16 max-w-4xl">
<h1 className="text-4xl font-bold mb-8">Changelog</h1>
2025-02-14 19:27:05 +01:00
{/* Eliminamos clases innecesarias para evitar que el HTML se vea como texto */}
2025-02-14 19:09:50 +01:00
<div
2025-02-14 19:27:05 +01:00
className="max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md"
style={{ whiteSpace: "normal" }} // Esto evita que el HTML se muestre como texto plano
dangerouslySetInnerHTML={{ __html: changelogContent }} // Renderiza el HTML correctamente
2025-02-14 19:09:50 +01:00
/>
2025-02-14 17:54:52 +01:00
</div>
2025-02-13 23:04:40 +01:00
</div>
)
2025-02-14 17:09:21 +01:00
}