diff --git a/next.config.js b/next.config.js index 71d4697..4e39f7e 100644 --- a/next.config.js +++ b/next.config.js @@ -10,6 +10,7 @@ const nextConfig = { }, basePath: "", assetPrefix: "", + trailingSlash: true, }; module.exports = nextConfig; diff --git a/src/app/course/[name]/page.tsx b/src/app/course/[name]/page.tsx new file mode 100644 index 0000000..e17c54c --- /dev/null +++ b/src/app/course/[name]/page.tsx @@ -0,0 +1,24 @@ +import Name from "@/components/course/name"; +import { courses } from "@/courses"; + +interface props { + params: { + name: string; + }; +} + +export const generateStaticParams = () => { + return courses.map(({ param }) => ({ name: param })); +}; + +const Page = ({ params }: props) => { + const { name } = params; + + return ( + <> + {name} + + ); +}; + +export default Page; diff --git a/src/app/course/page.tsx b/src/app/course/page.tsx new file mode 100644 index 0000000..668b304 --- /dev/null +++ b/src/app/course/page.tsx @@ -0,0 +1,5 @@ +const Page = () => { + return
Page
; +}; + +export default Page; diff --git a/src/components/courselayout.tsx b/src/components/course/layout.tsx similarity index 100% rename from src/components/courselayout.tsx rename to src/components/course/layout.tsx diff --git a/src/components/courselearn.tsx b/src/components/course/learn.tsx similarity index 100% rename from src/components/courselearn.tsx rename to src/components/course/learn.tsx diff --git a/src/components/course/name.tsx b/src/components/course/name.tsx new file mode 100644 index 0000000..1b01e71 --- /dev/null +++ b/src/components/course/name.tsx @@ -0,0 +1,12 @@ +interface CourseNameProps { + children: string; +} + +const Name = ({ children }: CourseNameProps) => { + return ( +
+ {children} +
+ ); +}; +export default Name; diff --git a/src/components/courseTimeline.tsx b/src/components/course/timeline.tsx similarity index 100% rename from src/components/courseTimeline.tsx rename to src/components/course/timeline.tsx diff --git a/src/courses/index.tsx b/src/courses/index.tsx new file mode 100644 index 0000000..77d69bf --- /dev/null +++ b/src/courses/index.tsx @@ -0,0 +1,6 @@ +export const courses = [ + { + name: "Introduction to Next.js", + param: "intro-nextjs", + }, +];