From e209cca43996945322d9866247061b1e8491fcfe Mon Sep 17 00:00:00 2001 From: ofershap <2589702+ofershap@users.noreply.github.com> Date: Sun, 15 Nov 2026 17:42:10 +0200 Subject: [PATCH] fix: serve crawler discovery statically and align product search content --- package.json | 5 +- public/llms.txt | 12 +-- public/robots.txt | 5 + public/sitemap.xml | 183 ++++++++++++++++++++++++++++++++ src/app/layout.tsx | 1 + src/app/page.tsx | 28 +++-- src/app/robots.ts | 14 --- src/app/sitemap.ts | 75 ------------- src/components/json-ld.tsx | 98 +++++++---------- tests/search-discovery.test.mjs | 16 +++ 10 files changed, 272 insertions(+), 165 deletions(-) create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml delete mode 100644 src/app/robots.ts delete mode 100644 src/app/sitemap.ts create mode 100644 tests/search-discovery.test.mjs diff --git a/package.json b/package.json index 1ab6f70..ad15af8 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,12 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build --webpack", + "build": "npm test && next build --webpack", "start": "next start", "lint": "eslint", "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", - "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy" + "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy", + "test": "node --test tests/*.test.mjs" }, "dependencies": { "@opennextjs/cloudflare": "^1.17.1", diff --git a/public/llms.txt b/public/llms.txt index d77a0f0..f2ccef4 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -1,6 +1,6 @@ # GitShow — Beautiful Developer Portfolio & Repository Showroom from Any GitHub Profile or Repo -> GitShow transforms any public GitHub profile into a stunning, auto-generated developer portfolio, and any public repository into an open source showroom. Replace github.com with gitshow.dev in any profile or repo URL — no signup, no config, no deploy. +> GitShow transforms any public GitHub profile into a auto-generated developer portfolio, and any public repository into an open source showroom. Replace github.com with gitshow.dev in any profile or repo URL — no signup, no config, no deploy. GitShow pulls data from the GitHub API and npm registry to show what GitHub doesn't: npm download stats, smart repo categorization, tech stack visualization, focus areas, project timelines, open source contribution history, and per-repo showrooms with team, languages, commit activity, community health, and latest releases. @@ -10,7 +10,7 @@ Replace `github.com` with `gitshow.dev` in any GitHub URL: - github.com/username → gitshow.dev/username (developer portfolio) - github.com/owner/repo → gitshow.dev/owner/repo (repository showroom) - Works for any public GitHub user, organization, or repository -- Data refreshes every hour via ISR caching +- Profiles and repository pages use a 24-hour revalidation interval. Cached data may remain visible while a refresh runs. ## Key Pages @@ -32,11 +32,11 @@ Replace `github.com` with `gitshow.dev` in any GitHub URL: - **Social Preview API (Profiles)** https://gitshow.dev/api/og/{username} - Dynamic 1200×630 OG image for profile sharing on Twitter and LinkedIn. + Pregenerated 1200×630 image for profile sharing. Refreshed daily; a default image is returned until a profile image is generated. - **Social Preview API (Repos)** https://gitshow.dev/api/og/{owner}/{repo} - Dynamic 1200×630 OG image for repository sharing with stats, contributors, and languages. + Pregenerated 1200×630 repository image. Refreshed daily; a default image is returned until a repository image is generated. ## Featured Profiles @@ -63,7 +63,7 @@ Replace `github.com` with `gitshow.dev` in any GitHub URL: - Tech stack language breakdown - Focus areas topic cloud - Project creation timeline -- Dynamic OG social cards for sharing +- Daily-refreshed OG social cards for sharing - README badge card for embedding - One-click share to X and LinkedIn @@ -86,7 +86,7 @@ Replace `github.com` with `gitshow.dev` in any GitHub URL: - Uses GitHub GraphQL API for contributions - Uses npm registry API for download statistics - Schema.org structured data: WebSite, SoftwareApplication, FAQPage, ProfilePage, SoftwareSourceCode, BreadcrumbList -- Deployed on Vercel +- Hosted on Cloudflare Workers - Open source under MIT license ## Source Code diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..b011270 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +User-Agent: * +Allow: / +Disallow: /api/ + +Sitemap: https://gitshow.dev/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..7e1acf7 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,183 @@ + + + +https://gitshow.dev +weekly +1 + + +https://gitshow.dev/ofershap +daily +0.8 + + +https://gitshow.dev/torvalds +daily +0.8 + + +https://gitshow.dev/sindresorhus +daily +0.8 + + +https://gitshow.dev/tj +daily +0.8 + + +https://gitshow.dev/gaearon +daily +0.8 + + +https://gitshow.dev/yyx990803 +daily +0.8 + + +https://gitshow.dev/addyosmani +daily +0.8 + + +https://gitshow.dev/kentcdodds +daily +0.8 + + +https://gitshow.dev/thedaviddias +daily +0.8 + + +https://gitshow.dev/jessfraz +daily +0.8 + + +https://gitshow.dev/mxstbr +daily +0.8 + + +https://gitshow.dev/Rich-Harris +daily +0.8 + + +https://gitshow.dev/antfu +daily +0.8 + + +https://gitshow.dev/tannerlinsley +daily +0.8 + + +https://gitshow.dev/ThePrimeagen +daily +0.8 + + +https://gitshow.dev/denoland +daily +0.8 + + +https://gitshow.dev/rauchg +daily +0.8 + + +https://gitshow.dev/shadcn +daily +0.8 + + +https://gitshow.dev/t3dotgg +daily +0.8 + + +https://gitshow.dev/leveluptuts +daily +0.8 + + +https://gitshow.dev/fireship-io +daily +0.8 + + +https://gitshow.dev/vercel/next.js +daily +0.7 + + +https://gitshow.dev/facebook/react +daily +0.7 + + +https://gitshow.dev/denoland/deno +daily +0.7 + + +https://gitshow.dev/tailwindlabs/tailwindcss +daily +0.7 + + +https://gitshow.dev/vuejs/core +daily +0.7 + + +https://gitshow.dev/sveltejs/svelte +daily +0.7 + + +https://gitshow.dev/oven-sh/bun +daily +0.7 + + +https://gitshow.dev/withastro/astro +daily +0.7 + + +https://gitshow.dev/vitejs/vite +daily +0.7 + + +https://gitshow.dev/drizzle-team/drizzle-orm +daily +0.7 + + +https://gitshow.dev/trpc/trpc +daily +0.7 + + +https://gitshow.dev/colinhacks/zod +daily +0.7 + + +https://gitshow.dev/honojs/hono +daily +0.7 + + +https://gitshow.dev/modelcontextprotocol/servers +daily +0.7 + + diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 830424c..42e3ea3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -14,6 +14,7 @@ export const metadata: Metadata = { "Turn GitHub profiles and repos into portfolios and project showrooms with npm stats, repo categories, and tech stacks. Free, open source, no signup.", applicationName: "GitShow", verification: { + google: "zn8NNlKIe-7WU0kPAKfIDcZmwISpj499v9dFBXpCsDE", other: { "msvalidate.01": "AAD3E490305203BA80DF599EC9F9067F" }, }, keywords: [ diff --git a/src/app/page.tsx b/src/app/page.tsx index eb4630b..c205577 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -4,7 +4,7 @@ import { UrlSwap } from "@/components/url-swap"; import { UsernameInput } from "@/components/username-input"; import { ProfileTicker } from "@/components/profile-ticker"; import { Footer } from "@/components/footer"; -import { JsonLd, websiteJsonLd, webApplicationJsonLd, faqPageJsonLd } from "@/components/json-ld"; +import { JsonLd, websiteJsonLd, webApplicationJsonLd, faqPageJsonLd, productFaqs } from "@/components/json-ld"; const svg = (children: ReactNode) => ( @@ -46,7 +46,7 @@ const FEATURES: { icon: ReactNode; title: string; text: string }[] = [ { icon: svg(<>>), title: "Social Preview Cards", - text: "Dynamic 1200x630 OG images generated per profile. Looks good when shared on X and LinkedIn.", + text: "1200x630 profile and repository preview images for X and LinkedIn. Generated images refresh daily; new pages use a default image until the next refresh.", }, { icon: svg(<>>), @@ -55,8 +55,8 @@ const FEATURES: { icon: ReactNode; title: string; text: string }[] = [ }, { icon: svg(<>>), - title: "LLM & GEO Ready", - text: "Schema.org structured data, llms.txt, AI crawler access. Built to surface in ChatGPT, Perplexity, and Google AI.", + title: "Readable profile data", + text: "Server-rendered profiles and repository pages include structured data and links to the original GitHub sources.", }, ]; @@ -173,7 +173,7 @@ export default function Home() { step="3" title="Share on social" code="https://gitshow.dev/your-username" - text="Every profile has a dynamic OG image. Paste the link on X or LinkedIn and it looks great." + text="Share a profile or repository link on X or LinkedIn. Preview images refresh daily; a new page may use the default image first." /> @@ -202,13 +202,29 @@ export default function Home() { + + + + About GitShow + + + {productFaqs.map(({ question, answer }) => ( + + {question} + {answer} + + ))} + + + + Open source, free, no strings - MIT licensed. Self-host it, fork it, contribute. Built with Next.js, React, TypeScript, and Tailwind CSS. Deployed on Vercel. + MIT licensed. Self-host it, fork it, contribute. Built with Next.js, React, TypeScript, and Tailwind CSS. Hosted on Cloudflare Workers. ({ - url: `${base}/${username}`, - lastModified: new Date(), - changeFrequency: "daily" as const, - priority: 0.8, - }), - ); - - const repoPages: MetadataRoute.Sitemap = FEATURED_REPOS.map( - (slug) => ({ - url: `${base}/${slug}`, - lastModified: new Date(), - changeFrequency: "daily" as const, - priority: 0.7, - }), - ); - - return [...staticPages, ...profilePages, ...repoPages]; -} diff --git a/src/components/json-ld.tsx b/src/components/json-ld.tsx index df1561e..75cdd4f 100644 --- a/src/components/json-ld.tsx +++ b/src/components/json-ld.tsx @@ -9,7 +9,7 @@ export function JsonLd({ data }: JsonLdProps) { return ( ); } @@ -21,7 +21,7 @@ export function websiteJsonLd() { name: "GitShow", url: "https://gitshow.dev", description: - "Replace github.com with gitshow.dev in any profile or repository URL to get a stunning developer portfolio or open source showroom.", + "Replace github.com with gitshow.dev in any profile or repository URL to get a developer portfolio or open source showroom.", potentialAction: { "@type": "SearchAction", target: { @@ -42,7 +42,7 @@ export function webApplicationJsonLd() { applicationCategory: "DeveloperApplication", operatingSystem: "Web", description: - "Generate a stunning developer portfolio from any public GitHub profile, or a showroom page for any repository. Replace github.com with gitshow.dev — no signup, no config, no deploy.", + "Generate a developer portfolio from any public GitHub profile, or a showroom page for any repository. Replace github.com with gitshow.dev — no signup, no config, no deploy.", featureList: [ "npm download statistics across all packages", "Smart repo categorization by type (MCP Servers, CLI Tools, React & UI, DevOps, AI & ML)", @@ -50,7 +50,7 @@ export function webApplicationJsonLd() { "Tech stack language breakdown visualization", "Focus areas topic cloud", "Project creation timeline", - "Dynamic OG social cards for Twitter and LinkedIn", + "Daily-refreshed social preview cards for X and LinkedIn", "Embeddable README badge card", "One-click share to X and LinkedIn", "Works for users, organizations, and repositories", @@ -75,68 +75,42 @@ export function webApplicationJsonLd() { }; } +export const productFaqs = [ + { + question: "What is GitShow?", + answer: "GitShow is a free, open source GitHub portfolio generator. It turns a public GitHub profile into a portfolio, and a public repository into a project showroom. It is a separate project, not a GitHub product.", + }, + { + question: "How do I turn my GitHub profile into a portfolio?", + answer: "Replace github.com with gitshow.dev in your profile URL. For example, github.com/ofershap becomes gitshow.dev/ofershap. You do not need to sign up, connect a GitHub account, or deploy a site.", + }, + { + question: "What does GitShow add to a GitHub profile?", + answer: "It groups original projects by category and shows npm download statistics, public contribution activity, languages, and focus areas. Repository pages show contributors, commit activity, community health, releases, and recent issues and pull requests. Available data varies by profile and repository.", + }, + { + question: "Does it work for organizations and individual repositories?", + answer: "Yes. Use gitshow.dev/organization for a public organization, or gitshow.dev/owner/repo for a public repository. Private repositories are not supported.", + }, + { + question: "How current are the data and social preview images?", + answer: "Profile and repository pages use a 24-hour revalidation interval. Cached data can remain visible while a refresh runs. Social preview images are generated in a daily refresh; a new page may show the default image until the next refresh. GitHub API limits or a failed refresh can delay updates.", + }, + { + question: "Can I embed a portfolio badge in my README?", + answer: "Yes. Use the README badge example above and replace YOUR_USERNAME with your GitHub username. The badge links back to your GitShow profile. GitShow is free to use and its source is available under the MIT license.", + }, +]; + export function faqPageJsonLd() { return { "@context": "https://schema.org", "@type": "FAQPage", - mainEntity: [ - { - "@type": "Question", - name: "What is GitShow?", - acceptedAnswer: { - "@type": "Answer", - text: "GitShow is a free, open source tool that transforms any public GitHub profile into a beautiful developer portfolio, and any repository into an open source showroom. Replace github.com with gitshow.dev in any profile or repo URL to see it in action.", - }, - }, - { - "@type": "Question", - name: "How do I use GitShow?", - acceptedAnswer: { - "@type": "Answer", - text: "Replace github.com with gitshow.dev in any GitHub URL. For profiles: github.com/torvalds becomes gitshow.dev/torvalds. For repos: github.com/vercel/next.js becomes gitshow.dev/vercel/next.js. No signup, no configuration, no deployment needed.", - }, - }, - { - "@type": "Question", - name: "What does GitShow show that GitHub doesn't?", - acceptedAnswer: { - "@type": "Answer", - text: "GitShow shows npm download statistics, smart repo categorization (MCP Servers, CLI Tools, React & UI, DevOps, etc.), open source contributions to external projects, tech stack visualization, focus areas, project creation timelines, and dynamic social preview cards.", - }, - }, - { - "@type": "Question", - name: "Is GitShow free?", - acceptedAnswer: { - "@type": "Answer", - text: "Yes, GitShow is completely free and open source under the MIT license. You can also self-host it or fork it.", - }, - }, - { - "@type": "Question", - name: "Does GitShow work with GitHub organizations?", - acceptedAnswer: { - "@type": "Answer", - text: "Yes, GitShow works with both personal GitHub profiles and organization profiles. Just use gitshow.dev/org-name.", - }, - }, - { - "@type": "Question", - name: "Can I use GitShow for a specific repository?", - acceptedAnswer: { - "@type": "Answer", - text: "Yes. Use gitshow.dev/owner/repo to see any public repository as a showroom page with the team, language breakdown, commit activity, community health, latest release, and recent issues and pull requests.", - }, - }, - { - "@type": "Question", - name: "How do I add a GitShow badge to my README?", - acceptedAnswer: { - "@type": "Answer", - text: "Add this markdown to your README: [](https://gitshow.dev/USERNAME). Replace USERNAME with your GitHub username. The badge updates automatically every hour.", - }, - }, - ], + mainEntity: productFaqs.map(({ question, answer }) => ({ + "@type": "Question", + name: question, + acceptedAnswer: { "@type": "Answer", text: answer }, + })), }; } diff --git a/tests/search-discovery.test.mjs b/tests/search-discovery.test.mjs new file mode 100644 index 0000000..ec4720c --- /dev/null +++ b/tests/search-discovery.test.mjs @@ -0,0 +1,16 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +const sitemap=fs.readFileSync(new URL('../public/sitemap.xml',import.meta.url),'utf8'); +const urls=[...sitemap.matchAll(/(.*?)<\/loc>/g)].map(x=>x[1]); +test('sitemap keeps the36canonical public URLs without invented dates',()=>{ + assert.equal(urls.length,36);assert.equal(new Set(urls).size,36); + assert.ok(urls.every(u=>u.startsWith('https://gitshow.dev'))); + for(const u of ['https://gitshow.dev','https://gitshow.dev/ofershap','https://gitshow.dev/vercel/next.js'])assert.ok(urls.includes(u)); + assert.ok(!sitemap.includes(''));assert.ok(!urls.some(u=>u.includes('/api/'))); +}); +test('crawler discovery routes are static, not Next worker routes',()=>{ + for(const f of ['robots.ts','sitemap.ts'])assert.ok(!fs.existsSync(new URL('../src/app/'+f,import.meta.url))); + const robots=fs.readFileSync(new URL('../public/robots.txt',import.meta.url),'utf8'); + assert.match(robots,/User-Agent: \*/i);assert.match(robots,/Allow: \//);assert.match(robots,/Disallow: \/api\//);assert.match(robots,/Sitemap: https:\/\/gitshow.dev\/sitemap.xml/); +});
- MIT licensed. Self-host it, fork it, contribute. Built with Next.js, React, TypeScript, and Tailwind CSS. Deployed on Vercel. + MIT licensed. Self-host it, fork it, contribute. Built with Next.js, React, TypeScript, and Tailwind CSS. Hosted on Cloudflare Workers.