From 3b9109a1dc364a03cc60187e090595f121996da1 Mon Sep 17 00:00:00 2001 From: igiallan Date: Sun, 28 Jul 2024 21:59:19 -0400 Subject: [PATCH] pls let the build errors be fixed --- config/pastProjects.json | 9 ++++++--- pages/projects/[...slug].jsx | 11 ++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/config/pastProjects.json b/config/pastProjects.json index 2572f73..ff3501a 100644 --- a/config/pastProjects.json +++ b/config/pastProjects.json @@ -99,13 +99,16 @@ ], "Fall 2022": [ { - "label": "College Football" + "label": "College Football", + "googleSlides": "https://docs.google.com/document/d/1aD0UfCwea5I35nqoAEfS0PNpnzrAv3LX-X4kTCLVuu4/" }, { - "label": "Dogs vs Cats" + "label": "Dogs vs Cats", + "googleSlides": "https://docs.google.com/presentation/d/1p-nNSJNfZd09ApFk05hJZfRlY2Z8PlsiVTgp0i6_U44/" }, { - "label": "Image Super Resolution" + "label": "Image Super Resolution", + "googleSlides": "https://drive.google.com/file/d/1cKrjVCl-M5wXzARgPMj8Gr-foZpEkIS_/" }, { "label": "Language Translation Application" diff --git a/pages/projects/[...slug].jsx b/pages/projects/[...slug].jsx index 4100877..902823e 100644 --- a/pages/projects/[...slug].jsx +++ b/pages/projects/[...slug].jsx @@ -9,9 +9,14 @@ import HeadContent from "@/components/headContent"; // Function to get all projects from JSON files const getAllProjects = () => { - const pastProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'pastProjects.json'), 'utf-8')); - const currentProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'currentProjects.json'), 'utf-8')); - return [...pastProjects, ...currentProjects]; + try { + const pastProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'pastProjects.json'), 'utf-8')); + const currentProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'currentProjects.json'), 'utf-8')); + return [...pastProjects, ...currentProjects]; + } catch (error) { + console.error("Error reading or parsing JSON files:", error); + return []; + } }; function ProjectPage({ content, title, images }) {