diff --git a/AGENTS.md b/AGENTS.md index 7f7cda4..ba2badd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,4 @@ -# AGENTS.md - AI Agent Guidelines for celeroncoder.tech +# AGENTS.md - AI Agent Guidelines for celeroncoder.com > Personal portfolio website built with Next.js 13 (App Router), TypeScript, and Tailwind CSS. @@ -130,9 +130,12 @@ export function Projects() { 1. **Client components**: Components using `motion`, hooks, or event handlers need `"use client"` 2. **Fonts**: none are loaded; the site uses system Times New Roman / Courier New on purpose. 3. **Anchor navigation**: Section IDs use lowercase (`id={title.toLowerCase()}`) -4. **Home page**: name, then the full post list (`components/post-index.tsx`). No about or projects - sections; that data in `lib/site-content.ts` still feeds the Markdown mirrors (`lib/markdown-pages.ts`). -5. **No API routes**: Static portfolio site +4. **Home page**: name, then the full post list (`components/post-index.tsx`). The Markdown mirror + (`lib/markdown-pages.ts`) matches it: name, all posts, contact links. +5. **SEO**: site-wide name, OG/Twitter image (the GitHub avatar URL) and handle live in + `lib/site-content.ts`. There is deliberately no site-wide description. Child `openGraph`/`twitter` + objects replace the layout's wholesale, so pages that set them must pass every field (including `images`). +6. **No API routes**: Static portfolio site --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e99d95..30f936c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ All notable changes to this project are documented here. The format is based on ### Changed +- **Link previews and SEO**: the site URL is now `https://www.celeroncoder.com` + (the old `.tech` domain is gone). Every page has Open Graph and Twitter + cards using the GitHub avatar; posts use their 1200×630 hero crop when they + have one. The old "Full Stack Web Developer based in Jaipur" title and + description are removed (pages other than posts have no description), titles use a `%s | Khushal + Bhardwaj` template, pages set their own canonical URL, and 404s are noindex. +- **Markdown home mirror matches the home page**: `/.md` is now the name, + every post, and contact links. The old headline, + skills, about, and projects content is removed from `lib/site-content.ts`. - **Early-web redesign**: every page is a plain white document in Times New Roman with classic blue/purple underlined links, a `[ GitHub | Twitter ]` link bar, encyclopedia-style titles, text straight on the page (no card), a diff --git a/README.md b/README.md index 31c0962..46c8a13 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# celeroncoder.tech +# celeroncoder.com This is my personal portfolio website. diff --git a/app/(frontend)/blog/[slug]/page.tsx b/app/(frontend)/blog/[slug]/page.tsx index f590d0a..c5b730f 100644 --- a/app/(frontend)/blog/[slug]/page.tsx +++ b/app/(frontend)/blog/[slug]/page.tsx @@ -12,6 +12,7 @@ import type { Media as MediaType, Tag } from "@/payload-types"; import { extractHeadings } from "@/lib/blog-toc"; import { ContentsBox } from "@/components/contents-box"; import { RetroPage, RetroTitle } from "@/components/retro-page"; +import { SITE_IMAGE, SITE_NAME, SITE_URL, TWITTER_HANDLE } from "@/lib/site-content"; export const dynamic = "force-dynamic"; @@ -29,12 +30,48 @@ export async function generateMetadata({ params }: Props): Promise { limit: 1, }); - if (!post) return { title: "Post not found" }; + if (!post) return { title: "Post not found", robots: { index: false, follow: false } }; + + const title = post.meta?.title || post.title; + const description = post.meta?.description || post.excerpt; + const url = `/blog/${slug}`; + const hero = typeof post.heroImage === "object" ? post.heroImage : null; + const heroFile = hero?.sizes?.hero?.url ? hero.sizes.hero : hero; + const image = heroFile?.url + ? { + url: heroFile.url, + alt: hero?.alt || title, + ...(heroFile.width && heroFile.height + ? { width: heroFile.width, height: heroFile.height } + : {}), + } + : SITE_IMAGE; return { - title: `${post.meta?.title || post.title} | Khushal Bhardwaj`, - description: post.meta?.description || post.excerpt, + title, + description, + openGraph: { + type: "article", + url, + siteName: SITE_NAME, + title, + description, + locale: "en_US", + publishedTime: post.publishedAt, + modifiedTime: post.updatedAt, + authors: [SITE_URL], + images: [image], + }, + twitter: { + card: heroFile?.url ? "summary_large_image" : "summary", + site: TWITTER_HANDLE, + creator: TWITTER_HANDLE, + title, + description, + images: [image], + }, alternates: { + canonical: url, types: { "text/markdown": `/blog/${slug}.md`, }, diff --git a/app/(frontend)/blog/page.tsx b/app/(frontend)/blog/page.tsx index b2b1a1b..68dd111 100644 --- a/app/(frontend)/blog/page.tsx +++ b/app/(frontend)/blog/page.tsx @@ -3,11 +3,29 @@ export const dynamic = "force-dynamic"; import type { Metadata } from "next"; import { PostIndex } from "@/components/post-index"; import { RetroPage, RetroTitle } from "@/components/retro-page"; +import { SITE_IMAGE, SITE_NAME, TWITTER_HANDLE } from "@/lib/site-content"; + +const title = `Blog | ${SITE_NAME}`; export const metadata: Metadata = { - title: "Blog | Khushal Bhardwaj", - description: "Blog posts by Khushal Bhardwaj", + title: "Blog", + openGraph: { + type: "website", + url: "/blog", + siteName: SITE_NAME, + title, + locale: "en_US", + images: [SITE_IMAGE], + }, + twitter: { + card: "summary", + site: TWITTER_HANDLE, + creator: TWITTER_HANDLE, + title, + images: [SITE_IMAGE], + }, alternates: { + canonical: "/blog", types: { "text/markdown": "/blog.md", }, diff --git a/app/(frontend)/layout.tsx b/app/(frontend)/layout.tsx index fd73ec5..68b48c2 100644 --- a/app/(frontend)/layout.tsx +++ b/app/(frontend)/layout.tsx @@ -3,12 +3,35 @@ import type { Metadata, Viewport } from "next"; import Script from "next/script"; import { Analytics } from "@vercel/analytics/next"; import { SpeedInsights } from "@vercel/speed-insights/next"; -import { SITE_URL } from "@/lib/site-content"; +import { + SITE_IMAGE, + SITE_NAME, + SITE_URL, + TWITTER_HANDLE, +} from "@/lib/site-content"; export const metadata: Metadata = { metadataBase: new URL(SITE_URL), - title: "Khushal Bhardwaj", - description: "Full-stack Software Engineer", + title: { + default: SITE_NAME, + template: `%s | ${SITE_NAME}`, + }, + authors: [{ name: SITE_NAME, url: SITE_URL }], + creator: SITE_NAME, + openGraph: { + type: "website", + siteName: SITE_NAME, + title: SITE_NAME, + locale: "en_US", + images: [SITE_IMAGE], + }, + twitter: { + card: "summary", + site: TWITTER_HANDLE, + creator: TWITTER_HANDLE, + title: SITE_NAME, + images: [SITE_IMAGE], + }, icons: { icon: "/icon.svg", apple: "/icon.svg", diff --git a/app/(frontend)/llm-markdown/[[...path]]/route.ts b/app/(frontend)/llm-markdown/[[...path]]/route.ts index 82806b4..c6ad080 100644 --- a/app/(frontend)/llm-markdown/[[...path]]/route.ts +++ b/app/(frontend)/llm-markdown/[[...path]]/route.ts @@ -80,7 +80,7 @@ export async function GET(_request: Request, { params }: RouteContext) { collection: "posts", where: POSTS_WITH_SLUG, sort: "-publishedAt", - limit: 5, + pagination: false, }); return markdownResponse( diff --git a/app/(frontend)/not-found.tsx b/app/(frontend)/not-found.tsx index 2e26605..8de8022 100644 --- a/app/(frontend)/not-found.tsx +++ b/app/(frontend)/not-found.tsx @@ -1,6 +1,12 @@ +import type { Metadata } from "next"; import Link from "next/link"; import { RetroPage, RetroTitle } from "@/components/retro-page"; +export const metadata: Metadata = { + title: "Page not found", + robots: { index: false, follow: false }, +}; + export default function NotFound() { return ( diff --git a/app/(frontend)/page.tsx b/app/(frontend)/page.tsx index 2d49829..55cda24 100644 --- a/app/(frontend)/page.tsx +++ b/app/(frontend)/page.tsx @@ -3,13 +3,32 @@ export const dynamic = "force-dynamic"; import type { Metadata } from "next"; import { PostIndex } from "@/components/post-index"; import { RetroPage, RetroTitle } from "@/components/retro-page"; -import { profile } from "@/lib/site-content"; +import { + profile, + SITE_IMAGE, + SITE_NAME, + TWITTER_HANDLE, +} from "@/lib/site-content"; export const metadata: Metadata = { - title: "Khushal Bhardwaj | Full Stack Web Developer", - description: - "Portfolio of Khushal Bhardwaj, a Full Stack Web Developer based in Jaipur, India, building web apps with React and Next.js.", + title: { absolute: SITE_NAME }, + openGraph: { + type: "website", + url: "/", + siteName: SITE_NAME, + title: SITE_NAME, + locale: "en_US", + images: [SITE_IMAGE], + }, + twitter: { + card: "summary", + site: TWITTER_HANDLE, + creator: TWITTER_HANDLE, + title: SITE_NAME, + images: [SITE_IMAGE], + }, alternates: { + canonical: "/", types: { "text/markdown": "/.md", }, diff --git a/lib/markdown-pages.ts b/lib/markdown-pages.ts index 4556c6f..b798313 100644 --- a/lib/markdown-pages.ts +++ b/lib/markdown-pages.ts @@ -1,9 +1,6 @@ import type { Post, Tag } from "@/payload-types"; import { - aboutParagraphs, profile, - projects, - skills, socialLinks, writingLinks, } from "@/lib/site-content"; @@ -47,22 +44,7 @@ function postHtmlUrl(origin: string, slug: string): string { } export function renderHomeMarkdown(posts: Post[], origin: string): string { - const projectSections = projects.map((project) => { - const links = [ - project.githubUrl - ? markdownLink("GitHub", project.githubUrl) - : "Private repository", - project.liveUrl ? markdownLink("Live", project.liveUrl) : null, - ].filter((link): link is string => link !== null); - - return [ - `### ${project.title}`, - project.description, - links.join(" | "), - ].join("\n\n"); - }); - - const blogItems = posts.map( + const postItems = posts.map( (post) => `- ${markdownLink(post.title, postMarkdownUrl(origin, post.slug))} (${formatDate(post.publishedAt)})`, ); @@ -75,17 +57,8 @@ export function renderHomeMarkdown(posts: Post[], origin: string): string { return [ `# ${profile.name}`, - `**${profile.headline}**`, - profile.introduction, - "## Top skills", - skills.map((skill) => `- ${skill}`).join("\n"), - "## About", - aboutParagraphs.join("\n\n"), - "## Projects", - projectSections.join("\n\n"), - "## Blog", - blogItems.length > 0 ? blogItems.join("\n") : "No posts yet.", - markdownLink("View all posts", absoluteUrl(origin, "/blog.md")), + "## Posts", + postItems.length > 0 ? postItems.join("\n") : "No posts yet.", "## Contact", contactLinks.map((link) => `- ${link}`).join("\n"), ].join("\n\n"); diff --git a/lib/site-content.ts b/lib/site-content.ts index 1366682..d7bc674 100644 --- a/lib/site-content.ts +++ b/lib/site-content.ts @@ -1,72 +1,19 @@ -export const SITE_URL = "https://celeroncoder.tech"; +export const SITE_URL = "https://www.celeroncoder.com"; +export const SITE_NAME = "Khushal Bhardwaj"; +// GitHub avatar, served by GitHub so it works on every deployment. +export const SITE_IMAGE = { + url: "https://avatars.githubusercontent.com/u/76873719?v=4", + width: 375, + height: 375, + alt: "Khushal Bhardwaj", +} as const; +export const TWITTER_HANDLE = "@celeroncoder"; export const profile = { name: "Khushal Bhardwaj", email: "celeroncoder@gmail.com", - headline: "Full Stack Web Developer", - introduction: - "Full Stack Web Developer based in Jaipur, India. Passionate about building web apps with React and Next.js. Currently an undergrad at VIT Bhopal University.", -} as const; - -export const about = { - beforeName: "Hey, I'm ", - afterName: - ", a Full Stack Web Developer based in Jaipur, India. Passionate about building web apps with React/NextJS. I'm also an undergrad at VIT Bhopal University.", - writing: - "Other than programming, I write blogs. I've developed a hobby of writing blogs, mostly technical. Although I may not be following it that regularly, you might think, but I do love it.", } as const; -export const aboutParagraphs = [ - `${about.beforeName}${profile.name}${about.afterName}`, - about.writing, -] as const; - -export const skills = [ - "TypeScript", - "Next.js", - "tRPC", - "Express.js", - "Prisma", - "Tailwind CSS", -] as const; - -export type Project = { - title: string; - description: string; - githubUrl?: string; - liveUrl?: string; -}; - -export const projects: Project[] = [ - { - title: "Shire", - description: - "A macOS native Claude Code wrapper with all the functionalities of Claude Code", - githubUrl: "https://github.com/celeroncoder/shire", - liveUrl: "https://shire.celeroncoder.com", - }, - { - title: "Curewell Admin", - description: - "Extensive CRM Dashboard for Homeopathic Clinic built with Next.js and tRPC", - }, - { - title: "PlayerStatPML", - description: - "Express-TypeScript API proxy for Premier League statistics", - githubUrl: "https://github.com/celeronCoder/playerstatpml", - liveUrl: - "https://rapidapi.com/celeronCoder/api/premier-league-player-and-club-statistics", - }, - { - title: "winston-highstorm", - description: - "NPM Package for winston Transport to ingest logs to highstorm.app", - githubUrl: "https://github.com/celeronCoder/winston-highstorm", - liveUrl: "https://link.celeroncoder.tech/winston-transport-npm", - }, -]; - export const socialLinks = [ { name: "GitHub", url: "https://github.com/celeroncoder" }, { name: "Twitter", url: "https://twitter.com/celeroncoder" },