From 87258a10e52075e5f3c146fe98739a20337881d8 Mon Sep 17 00:00:00 2001 From: Manthan Solanki Date: Mon, 31 Mar 2025 01:24:03 +0200 Subject: [PATCH 1/8] major update - 1 --- LICENSE | 21 -- app/Main.tsx | 28 ++- app/about/page.tsx | 63 ++---- app/components/ArchiveButton.tsx | 12 ++ app/learn/[...slug]/page.tsx | 120 +++++++++++ app/learn/page.tsx | 44 ++++ app/learn/page/[page]/page.tsx | 42 ++++ app/newsletter/page.tsx | 54 +++++ app/sitemap.ts | 2 +- app/tag-data.json | 2 + components/ArchiveButton.tsx | 12 ++ components/social-icons/icons.tsx | 6 +- data/authors/default.mdx | 16 -- .../diffusion-models-in-inverse-design.mdx | 198 ++++++++++++++++++ data/courseData.ts | 25 +++ data/headerNavLinks.ts | 4 +- faq/custom-mdx-component.md | 61 ------ faq/customize-kbar-search.md | 91 -------- faq/deploy-with-docker.md | 20 -- layouts/AuthorLayout.tsx | 56 ----- layouts/PageLayout.tsx | 27 +++ package.json | 5 +- public/static/images/avatar.png | Bin 5462 -> 0 bytes public/static/images/canada/lake.jpg | Bin 41767 -> 0 bytes public/static/images/canada/maple.jpg | Bin 57747 -> 0 bytes public/static/images/canada/mountains.jpg | Bin 705444 -> 0 bytes public/static/images/canada/toronto.jpg | Bin 79963 -> 0 bytes public/static/images/github-traffic.png | Bin 35850 -> 0 bytes public/static/images/google.png | Bin 30353 -> 0 bytes .../static/images/learn/machine-learning.png | Bin 0 -> 95861 bytes public/static/images/learn/robotics.png | Bin 0 -> 54761 bytes public/static/images/learn/software-dev.png | Bin 0 -> 49563 bytes public/static/images/ocean.jpeg | Bin 262353 -> 0 bytes public/static/images/sparrowhawk-avatar.jpg | Bin 15300 -> 0 bytes public/static/images/time-machine.jpg | Bin 429232 -> 0 bytes yarn.lock | 191 +++++++++++------ 36 files changed, 723 insertions(+), 377 deletions(-) delete mode 100644 LICENSE create mode 100644 app/components/ArchiveButton.tsx create mode 100644 app/learn/[...slug]/page.tsx create mode 100644 app/learn/page.tsx create mode 100644 app/learn/page/[page]/page.tsx create mode 100644 app/newsletter/page.tsx create mode 100644 components/ArchiveButton.tsx delete mode 100644 data/authors/default.mdx create mode 100644 data/blog/diffusion-models-in-inverse-design.mdx create mode 100644 data/courseData.ts delete mode 100644 faq/custom-mdx-component.md delete mode 100644 faq/customize-kbar-search.md delete mode 100644 faq/deploy-with-docker.md delete mode 100644 layouts/AuthorLayout.tsx create mode 100644 layouts/PageLayout.tsx delete mode 100644 public/static/images/avatar.png delete mode 100644 public/static/images/canada/lake.jpg delete mode 100644 public/static/images/canada/maple.jpg delete mode 100644 public/static/images/canada/mountains.jpg delete mode 100644 public/static/images/canada/toronto.jpg delete mode 100644 public/static/images/github-traffic.png delete mode 100644 public/static/images/google.png create mode 100644 public/static/images/learn/machine-learning.png create mode 100644 public/static/images/learn/robotics.png create mode 100644 public/static/images/learn/software-dev.png delete mode 100644 public/static/images/ocean.jpeg delete mode 100644 public/static/images/sparrowhawk-avatar.jpg delete mode 100644 public/static/images/time-machine.jpg diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 1d4ca09..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-2025 Timothy Lin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/app/Main.tsx b/app/Main.tsx index c91c706..142bbc3 100644 --- a/app/Main.tsx +++ b/app/Main.tsx @@ -4,15 +4,39 @@ import siteMetadata from '@/data/siteMetadata' import { formatDate } from 'pliny/utils/formatDate' import NewsletterForm from 'pliny/ui/NewsletterForm' -const MAX_DISPLAY = 5 +const MAX_DISPLAY = 3 export default function Home({ posts }) { return ( <> + {/* Hero Section with Background */} +
+
+
+
+

+ Master Cutting-Edge Technology +

+

+ Choose learning path in Software Development, AI, and Robotics +

+
+ + Get Started + +
+
+
+
+ + {/* Blog Posts Section */}

- Latest + Latest Blogs

{siteMetadata.description} diff --git a/app/about/page.tsx b/app/about/page.tsx index 97931c1..474ec88 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -1,73 +1,52 @@ -import { Authors, allAuthors } from 'contentlayer/generated' -import { MDXLayoutRenderer } from 'pliny/mdx-components' -import AuthorLayout from '@/layouts/AuthorLayout' -import { coreContent } from 'pliny/utils/contentlayer' +import PageLayout from '@/layouts/PageLayout' import { genPageMetadata } from 'app/seo' import { FaLaptopCode, FaNewspaper, FaRocket } from 'react-icons/fa' -import siteMetadata from '@/data/siteMetadata' -import NewsletterForm from 'pliny/ui/NewsletterForm' export const metadata = genPageMetadata({ title: 'About Us' }) -export default function Page() { - const author = allAuthors.find((p) => p.slug === 'default') as Authors - const mainContent = coreContent(author) - +export default function AboutUsPage() { return ( <> - +

- Welcome to codust.dev — your go-to - platform for exploring forefront of technology. + Welcome to codust.dev — your comprehensive + learning platform for mastering modern software development and emerging technologies.

- At Codust, we dive deep into cutting-edge advancements across multiple domains: AI, - Robotics, and other emerging innovations shaping the future. + At Codust, we focus on delivering practical, hands-on education in software development, + AI, robotics, and other cutting-edge technologies that are shaping our future.

-
- {/* Card 1 - Pink Theme */} +
+ {/* Card 1 - Practical Courses */}
-

AI & Robotics

+

Practical Courses

- Exploring cutting-edge developments in Artificial Intelligence, Machine Learning, - and Robotics. + Deep-dive into real-world focused courses covering software development, AI, and emerging + technologies. Learn through practical applications and industry-relevant projects.

- {/* Card 2 - Blue Theme */} + + {/* Card 2 - Tech Newsletter */}
-

Newsletter

+

Weekly Tech Updates

- Subscribe for weekly updates on the latest tech innovations, delivered straight to - your inbox. -

-
- {/* Card 3 - Cyan Theme */} -
- -

Projects & Tutorials

-

- Discover hands-on projects, tutorials, and insightful content to accelerate your - learning journey. + Stay ahead with our curated weekly newsletter covering the latest developments in + software, AI, and emerging technologies. Get insights that matter to your growth.

- Whether you're a developer, researcher, or tech enthusiast, you'll find insightful - content, projects, and discussions that aim to expand your knowledge and inspire new - ideas. + Whether you're a beginner starting your journey or an experienced professional looking + to expand your skillset, our practical courses and weekly updates will help you stay + competitive in today's rapidly evolving tech landscape.

- - {siteMetadata.newsletter?.provider && ( -
- -
- )} + ) } diff --git a/app/components/ArchiveButton.tsx b/app/components/ArchiveButton.tsx new file mode 100644 index 0000000..80bdb5a --- /dev/null +++ b/app/components/ArchiveButton.tsx @@ -0,0 +1,12 @@ +'use client' + +export default function ArchiveButton() { + return ( + + ) +} \ No newline at end of file diff --git a/app/learn/[...slug]/page.tsx b/app/learn/[...slug]/page.tsx new file mode 100644 index 0000000..af96a2b --- /dev/null +++ b/app/learn/[...slug]/page.tsx @@ -0,0 +1,120 @@ +import 'css/prism.css' +import 'katex/dist/katex.css' + +import PageTitle from '@/components/PageTitle' +import { components } from '@/components/MDXComponents' +import { MDXLayoutRenderer } from 'pliny/mdx-components' +import { sortPosts, coreContent, allCoreContent } from 'pliny/utils/contentlayer' +import { allBlogs, allAuthors } from 'contentlayer/generated' +import type { Authors, Blog } from 'contentlayer/generated' +import PostSimple from '@/layouts/PostSimple' +import PostLayout from '@/layouts/PostLayout' +import PostBanner from '@/layouts/PostBanner' +import { Metadata } from 'next' +import siteMetadata from '@/data/siteMetadata' +import { notFound } from 'next/navigation' + +const defaultLayout = 'PostLayout' +const layouts = { + PostSimple, + PostLayout, + PostBanner, +} + +export async function generateMetadata(props: { + params: Promise<{ slug: string[] }> +}): Promise { + const params = await props.params + const slug = decodeURI(params.slug.join('/')) + const post = allBlogs.find((p) => p.slug === slug) + const authorList = post?.authors || ['default'] + const authorDetails = authorList.map((author) => { + const authorResults = allAuthors.find((p) => p.slug === author) + return coreContent(authorResults as Authors) + }) + if (!post) { + return + } + + const publishedAt = new Date(post.date).toISOString() + const modifiedAt = new Date(post.lastmod || post.date).toISOString() + const authors = authorDetails.map((author) => author.name) + let imageList = [siteMetadata.socialBanner] + if (post.images) { + imageList = typeof post.images === 'string' ? [post.images] : post.images + } + const ogImages = imageList.map((img) => { + return { + url: img && img.includes('http') ? img : siteMetadata.siteUrl + img, + } + }) + + return { + title: post.title, + description: post.summary, + openGraph: { + title: post.title, + description: post.summary, + siteName: siteMetadata.title, + locale: 'en_US', + type: 'article', + publishedTime: publishedAt, + modifiedTime: modifiedAt, + url: './', + images: ogImages, + authors: authors.length > 0 ? authors : [siteMetadata.author], + }, + twitter: { + card: 'summary_large_image', + title: post.title, + description: post.summary, + images: imageList, + }, + } +} + +export const generateStaticParams = async () => { + return allBlogs.map((p) => ({ slug: p.slug.split('/').map((name) => decodeURI(name)) })) +} + +export default async function Page(props: { params: Promise<{ slug: string[] }> }) { + const params = await props.params + const slug = decodeURI(params.slug.join('/')) + // Filter out drafts in production + const sortedCoreContents = allCoreContent(sortPosts(allBlogs)) + const postIndex = sortedCoreContents.findIndex((p) => p.slug === slug) + if (postIndex === -1) { + return notFound() + } + + const prev = sortedCoreContents[postIndex + 1] + const next = sortedCoreContents[postIndex - 1] + const post = allBlogs.find((p) => p.slug === slug) as Blog + const authorList = post?.authors || ['default'] + const authorDetails = authorList.map((author) => { + const authorResults = allAuthors.find((p) => p.slug === author) + return coreContent(authorResults as Authors) + }) + const mainContent = coreContent(post) + const jsonLd = post.structuredData + jsonLd['author'] = authorDetails.map((author) => { + return { + '@type': 'Person', + name: author.name, + } + }) + + const Layout = layouts[post.layout || defaultLayout] + + return ( + <> +