Update page.tsx

This commit is contained in:
MacRimi 2025-02-14 18:52:54 +01:00 committed by GitHub
parent 0d39dbcd63
commit 1ccf796b07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,14 +1,14 @@
import fs from "fs" import fs from "fs"
import path from "path" import path from "path"
import ReactMarkdown from "react-markdown" import ReactMarkdown from "react-markdown"
import remarkGfm from "remark-gfm"
import remarkBreaks from "remark-breaks"
async function getChangelog() { async function getChangelog() {
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md") const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
try { try {
const fileContents = fs.readFileSync(changelogPath, "utf8") const fileContents = fs.readFileSync(changelogPath, "utf8")
return fileContents
// Asegurar que los saltos de línea dobles se respeten
return fileContents.replace(/\r?\n/g, " \n")
} catch (error) { } catch (error) {
console.error("Error reading changelog file:", error) console.error("Error reading changelog file:", error)
return "Changelog content not found." return "Changelog content not found."
@ -23,7 +23,9 @@ export default async function ChangelogPage() {
<div className="container mx-auto px-4 py-16 max-w-4xl"> <div className="container mx-auto px-4 py-16 max-w-4xl">
<h1 className="text-4xl font-bold mb-8">Changelog</h1> <h1 className="text-4xl font-bold mb-8">Changelog</h1>
<div className="prose prose-lg max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md"> <div className="prose prose-lg max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md">
<pre>{changelogContent}</pre> <ReactMarkdown remarkPlugins={[remarkGfm, remarkBreaks]}>
{changelogContent}
</ReactMarkdown>
</div> </div>
</div> </div>
</div> </div>