Update page.tsx

This commit is contained in:
MacRimi 2025-02-14 17:31:44 +01:00 committed by GitHub
parent 19dac7388a
commit 80779c8df3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,11 +4,17 @@ import { remark } from "remark"
import html from "remark-html"
async function getChangelog() {
const changelogPath = path.join(process.cwd(), "CHANGELOG.md")
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
try {
const fileContents = fs.readFileSync(changelogPath, "utf8")
const result = await remark().use(html).process(fileContents)
const result = await remark()
.use(html) // No usar sanitize: false a menos que sea seguro
.process(fileContents)
return result.toString()
} catch (error) {
console.error("Error reading changelog file:", error)
return "<p>Changelog content not found.</p>"
}
}
export default async function ChangelogPage() {