From 5fde2871bc3815f4f1ce24c10cd9a69083af1b31 Mon Sep 17 00:00:00 2001 From: igiallan Date: Sun, 28 Jul 2024 21:46:52 -0400 Subject: [PATCH] build errors fixed now?? --- pages/projects/[...slug].jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/projects/[...slug].jsx b/pages/projects/[...slug].jsx index 75130ac..6d9252e 100644 --- a/pages/projects/[...slug].jsx +++ b/pages/projects/[...slug].jsx @@ -30,11 +30,11 @@ function ProjectPage({ content, title, images }) { export async function getStaticProps({ params }) { const [subdirectory, innerDir] = params.slug; - const filePath = path.join(process.cwd(), 'public', 'projects', subdirectory, innerDir, 'writeup.md'); + const filePath = path.join(process.cwd(), 'content', 'projects', subdirectory, innerDir, 'writeup.md'); const fileContent = fs.readFileSync(filePath, 'utf-8'); - const imagesDir = path.join(process.cwd(), 'public', 'projects', subdirectory, innerDir, 'images'); - const images = fs.existsSync(imagesDir) ? fs.readdirSync(imagesDir).map(img => path.join('/projects', subdirectory, innerDir, 'images', img)) : []; + const imagesDir = path.join(process.cwd(), 'public', 'images', 'projects', subdirectory, innerDir); + const images = fs.existsSync(imagesDir) ? fs.readdirSync(imagesDir).map(img => path.join('/images/projects', subdirectory, innerDir, img)) : []; return { props: { @@ -46,7 +46,7 @@ export async function getStaticProps({ params }) { } export async function getStaticPaths() { - const projectsDirectory = path.join(process.cwd(), "public", "projects"); + const projectsDirectory = path.join(process.cwd(), "content", "projects"); const subdirectories = fs.readdirSync(projectsDirectory, { withFileTypes: true }).filter(dirent => dirent.isDirectory()); const paths = subdirectories.flatMap(subdirectory => {