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 } } ) } - -