From 7affb5f4e8bce870518e816129121b60c9412d81 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:50:19 +0100 Subject: [PATCH] Update page.tsx --- web/app/guides/[slug]/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/guides/[slug]/page.tsx b/web/app/guides/[slug]/page.tsx index 98d4eec..b3da8d1 100644 --- a/web/app/guides/[slug]/page.tsx +++ b/web/app/guides/[slug]/page.tsx @@ -5,7 +5,8 @@ import html from "remark-html" // Function to retrieve the guide content based on the slug async function getGuideContent(slug: string) { - const guidePath = path.join(process.cwd(), "guides", slug, "index.md") // Adjusted to look inside a folder + // Adjusted to look inside the correct 'guides' folder at the root level of the project + const guidePath = path.join(process.cwd(), "..", "guides", slug, "index.md") // Corrected to look in the root directory const fileContents = fs.readFileSync(guidePath, "utf8") const result = await remark().use(html).process(fileContents) @@ -14,7 +15,8 @@ async function getGuideContent(slug: string) { // Function to generate static paths for all available guides export async function generateStaticParams() { - const guidesPath = path.join(process.cwd(), "guides") + // Adjusted to look in the correct 'guides' folder at the root level of the project + const guidesPath = path.join(process.cwd(), "..", "guides") const guideFolders = fs.readdirSync(guidesPath, { withFileTypes: true }) // Read only directories return guideFolders @@ -34,5 +36,3 @@ export default async function GuidePage({ params }: { params: { slug: string } } ) } - -