diff --git a/lander/.gitignore b/lander/.gitignore index 5ef6a52..530208a 100644 --- a/lander/.gitignore +++ b/lander/.gitignore @@ -16,7 +16,7 @@ # next.js /.next/ /out/ - +dist # production /build diff --git a/lander/next.config.ts b/lander/next.config.ts index 2978fd3..17b6505 100644 --- a/lander/next.config.ts +++ b/lander/next.config.ts @@ -2,7 +2,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ - output: 'export', + distDir:'dist' }; export default nextConfig; diff --git a/lander/package-lock.json b/lander/package-lock.json index f27ad09..3c85604 100644 --- a/lander/package-lock.json +++ b/lander/package-lock.json @@ -11,6 +11,7 @@ "axios": "^1.7.9", "clsx": "^2.1.1", "framer-motion": "^12.4.3", + "gray-matter": "^4.0.3", "motion": "^12.4.3", "next": "15.1.7", "react": "^19.0.0", @@ -2647,6 +2648,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", @@ -2693,6 +2707,18 @@ "node": ">=0.10.0" } }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3152,6 +3178,43 @@ "dev": true, "license": "MIT" }, + "node_modules/gray-matter": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", + "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", + "license": "MIT", + "dependencies": { + "js-yaml": "^3.13.1", + "kind-of": "^6.0.2", + "section-matter": "^1.0.0", + "strip-bom-string": "^1.0.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/gray-matter/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/gray-matter/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -3460,6 +3523,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3851,6 +3923,15 @@ "json-buffer": "3.0.1" } }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/language-subtag-registry": { "version": "0.3.23", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", @@ -4966,6 +5047,19 @@ "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", "license": "MIT" }, + "node_modules/section-matter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", + "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1", + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -5205,6 +5299,12 @@ "node": ">=0.10.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, "node_modules/stable-hash": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", @@ -5447,6 +5547,15 @@ "node": ">=4" } }, + "node_modules/strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", diff --git a/lander/package.json b/lander/package.json index 7739a07..73531ec 100644 --- a/lander/package.json +++ b/lander/package.json @@ -17,7 +17,8 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "simplex-noise": "^4.0.3", - "tailwind-merge": "^3.0.1" + "tailwind-merge": "^3.0.1", + "gray-matter": "^4.0.3" }, "devDependencies": { "@eslint/eslintrc": "^3", diff --git a/lander/src/app/signin/page.tsx b/lander/src/app/signin/page.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/lander/src/components/index/AboutSection.tsx b/lander/src/components/index/AboutSection.tsx index bf8726f..199eb81 100644 --- a/lander/src/components/index/AboutSection.tsx +++ b/lander/src/components/index/AboutSection.tsx @@ -4,7 +4,6 @@ import logoImg from "./assets/images/brand/logo.png"; import img1 from "./assets/images/about-section-1.png"; import { motion } from "motion/react"; import { Ripple } from "./magicui/ripple"; -import Link from "next/link"; export default function AboutSection() { return ( diff --git a/lander/src/components/index/HeroSection.tsx b/lander/src/components/index/HeroSection.tsx index 27120ab..f3f1367 100644 --- a/lander/src/components/index/HeroSection.tsx +++ b/lander/src/components/index/HeroSection.tsx @@ -7,7 +7,6 @@ import { animate, } from "framer-motion"; import { Vortex } from "./ui/vortex"; -import Link from "next/link"; import axios from "axios"; const COLORS_TOP = ["rgba(255,255,255,0.25)"]; diff --git a/lander/src/lib/posts.ts b/lander/src/lib/posts.ts new file mode 100644 index 0000000..a355763 --- /dev/null +++ b/lander/src/lib/posts.ts @@ -0,0 +1,57 @@ +import fs from "fs"; +import path from "path"; + +import matter from "gray-matter"; + +// Define the types for the data +export interface SlugData { + id: string; + date: string; + + [key: string]: string; +} + +const postsDirectory = path.join(process.cwd(), "posts"); + +export function getSortedPostsData(): SlugData[] { + const fileNames = fs.readdirSync(postsDirectory); + const allPostsData: SlugData[] = fileNames.map((fileName) => { + const id = fileName.replace(/\.mdx$/, ""); + const fullPath = path.join(postsDirectory, fileName); + const fileContents = fs.readFileSync(fullPath, "utf8"); + const matterResult = matter(fileContents); + + return { + id, + date: matterResult.data.date as string, + ...matterResult.data, + }; + }); + + return allPostsData.sort((a, b) => { + if (a.date < b.date) { + return 1; + } else { + return -1; + } + }); +} + +export interface PostData { + slug: string; + content: string; + + [key: string]: string; +} + +export function getPostData(slug: string): PostData { + const fullPath = path.join(postsDirectory, `${slug}.mdx`); + const fileContents = fs.readFileSync(fullPath, "utf8"); + const matterResult = matter(fileContents); + + return { + slug, + ...matterResult.data, + content: matterResult.content, + }; +} diff --git a/lander/src/lib/utils.ts b/lander/src/lib/utils.ts new file mode 100644 index 0000000..365058c --- /dev/null +++ b/lander/src/lib/utils.ts @@ -0,0 +1,6 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/lander/tsconfig.json b/lander/tsconfig.json index c133409..ef91bdb 100644 --- a/lander/tsconfig.json +++ b/lander/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -19,9 +23,19 @@ } ], "paths": { - "@/*": ["./src/*"] + "@/*": [ + "./src/*" + ] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "include": [ + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "next-env.d.ts", + "dist/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] }