Update page.tsx

This commit is contained in:
MacRimi 2025-02-14 17:09:21 +01:00 committed by GitHub
parent 9e0bbc1d65
commit 3456457e2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,11 +4,15 @@ import { remark } from "remark"
import html from "remark-html"
async function getChangelog() {
const changelogPath = path.join(process.cwd(), "CHANGELOG.md")
const fileContents = fs.readFileSync(changelogPath, "utf8")
const result = await remark().use(html).process(fileContents)
return result.toString()
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
try {
const fileContents = fs.readFileSync(changelogPath, "utf8")
const result = await remark().use(html).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() {
@ -17,7 +21,7 @@ export default async function ChangelogPage() {
return (
<div className="container mx-auto px-4 py-16 max-w-4xl">
<h1 className="text-4xl font-bold mb-8">Changelog</h1>
<div className="prose prose-lg dark:prose-invert" dangerouslySetInnerHTML={{ __html: changelogContent }} />
<div className="prose prose-lg" dangerouslySetInnerHTML={{ __html: changelogContent }} />
</div>
)
}