From 82568dfa11f1fba0e28d1c6bf738525b4157763d Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:42:55 +0100 Subject: [PATCH] Update page.tsx --- web/app/guides/[slug]/page.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/guides/[slug]/page.tsx b/web/app/guides/[slug]/page.tsx index 6c90183..04e1273 100644 --- a/web/app/guides/[slug]/page.tsx +++ b/web/app/guides/[slug]/page.tsx @@ -4,7 +4,7 @@ import { remark } from "remark" import html from "remark-html" async function getGuideContent(slug: string) { - const guidePath = path.join(process.cwd(), "guides", `${slug}.md`) + const guidePath = path.join(process.cwd(), "..", "..", "guides", `${slug}.md`) const fileContents = fs.readFileSync(guidePath, "utf8") const result = await remark().use(html).process(fileContents) @@ -12,7 +12,8 @@ async function getGuideContent(slug: string) { } export async function generateStaticParams() { - const guideFiles = fs.readdirSync(path.join(process.cwd(), "guides")) + const guidesPath = path.join(process.cwd(), "..", "..", "guides") + const guideFiles = fs.readdirSync(guidesPath) return guideFiles.map((file) => ({ slug: file.replace(/\.md$/, ""), })) @@ -23,7 +24,7 @@ export default async function GuidePage({ params }: { params: { slug: string } } return (
-
+
) }