From 7f8bd86c5c0af5a65738048a6974c2452ebd9139 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:19:36 +0100 Subject: [PATCH] Update page.tsx --- web/app/changelog/page.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/app/changelog/page.tsx b/web/app/changelog/page.tsx index 92be156..720d291 100644 --- a/web/app/changelog/page.tsx +++ b/web/app/changelog/page.tsx @@ -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 "
Changelog content not found.
" + } } export default async function ChangelogPage() { @@ -17,8 +21,9 @@ export default async function ChangelogPage() { return (