From 6d3c546b726eb18c00ee6915dd5546d408124f73 Mon Sep 17 00:00:00 2001 From: Ayush <99096397+ayush4345@users.noreply.github.com> Date: Wed, 28 Feb 2024 00:43:39 +0530 Subject: [PATCH] added custom script --- package.json | 4 ++-- src/app/blogs/[blogid]/page.js | 3 ++- src/app/events/[eventid]/page.js | 3 ++- src/app/projects/[projectid]/page.jsx | 5 +++-- src/components/Navbar/Navbar.js | 9 --------- src/components/api.js | 14 ++++++++------ src/components/blog/blogDetail.jsx | 5 +++-- src/components/blog/blogList.jsx | 4 ++-- src/components/event/eventDetail.jsx | 5 +++-- src/components/event/eventList.jsx | 5 +++-- src/components/project/projectDetail.jsx | 7 ++++--- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 719a958..f0f4efd 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "build": "next build", "start": "next start", "lint": "next lint", - "static": "node script.js && next build && next export", - "custom-script": "node script.js" + "custom-script": "node script.js", + "static": "node script.js && next build && next export && touch ./out/.nojekyll && echo 'mbsaiaditya.github.io' > ./out/CNAME" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.1", diff --git a/src/app/blogs/[blogid]/page.js b/src/app/blogs/[blogid]/page.js index fd4e3d1..a572b14 100644 --- a/src/app/blogs/[blogid]/page.js +++ b/src/app/blogs/[blogid]/page.js @@ -1,4 +1,5 @@ import BlogId from "@/components/blog/blogDetail"; +import jsonData from '../../../../public/blog-response.json' export default function BlogDetail({ params }){ return( @@ -7,7 +8,7 @@ export default function BlogDetail({ params }){ } export async function generateStaticParams() { - const posts = await fetch('/blog-response.json').then((res) => res.json()) + const posts = jsonData return posts.items.map((post) => ({ blogid: post.blog_slug, diff --git a/src/app/events/[eventid]/page.js b/src/app/events/[eventid]/page.js index b142176..5bacaa4 100644 --- a/src/app/events/[eventid]/page.js +++ b/src/app/events/[eventid]/page.js @@ -1,4 +1,5 @@ import EventId from "@/components/event/eventDetail"; +import jsonData from '../../../../public/event-response.json' export default function EventDetail({ params }){ return( @@ -7,7 +8,7 @@ export default function EventDetail({ params }){ } export async function generateStaticParams() { - const posts = await fetch('/event-response.json').then((res) => res.json()) + const posts = jsonData return posts.items.map((post) => ({ eventid: post.event_slug, diff --git a/src/app/projects/[projectid]/page.jsx b/src/app/projects/[projectid]/page.jsx index 932413d..8fc58b0 100644 --- a/src/app/projects/[projectid]/page.jsx +++ b/src/app/projects/[projectid]/page.jsx @@ -1,4 +1,5 @@ import ProjectId from "@/components/project/projectDetail"; +import jsonData from '../../../../public/project-response.json' export default function ProjectDetail({ params }){ return( @@ -7,8 +8,8 @@ export default function ProjectDetail({ params }){ } export async function generateStaticParams() { - const posts = await fetch('/project-response.json').then((res) => res.json()) - + const posts = jsonData + return posts.items.map((post) => ({ projectid: post.project_slug, })) diff --git a/src/components/Navbar/Navbar.js b/src/components/Navbar/Navbar.js index c6c9cad..97353cf 100644 --- a/src/components/Navbar/Navbar.js +++ b/src/components/Navbar/Navbar.js @@ -62,15 +62,6 @@ const Navbar = () => { Projects -
  • - - Location - -
  • - {projectData.project_authors} + {projectData.project_authors}