From da2a2a21bcde45d4d31194894812c512080964b6 Mon Sep 17 00:00:00 2001 From: martyy-code Date: Fri, 5 Jun 2026 09:40:33 +0200 Subject: [PATCH 1/3] feat: comprehensive SEO optimization for @deessejs/errors website - Add robots.txt and sitemap.xml generation - Implement JSON-LD structured data (WebSite, Organization, SoftwareApplication, BreadcrumbList, TechArticle, APIReference) - Add Open Graph and Twitter Card metadata - Create dynamic OG images for homepage and documentation pages - Use branded banner for all social sharing images - Add XSS protection for all JSON-LD output Co-Authored-By: Claude Opus 4.7 --- apps/web/src/app/(home)/layout.tsx | 20 +++ apps/web/src/app/(home)/page.tsx | 28 +++- apps/web/src/app/docs/[[...slug]]/page.tsx | 79 ++++++++++- apps/web/src/app/layout.tsx | 51 +++++++- apps/web/src/app/og/docs/[...slug]/route.tsx | 131 ++++++++++++++++++- apps/web/src/app/opengraph-image.tsx | 124 ++++++++++++++++++ apps/web/src/app/robots.ts | 5 +- apps/web/src/app/sitemap.ts | 36 +++-- apps/web/src/app/twitter-image.tsx | 107 +++++++++++++++ apps/web/src/lib/shared.ts | 1 + 10 files changed, 558 insertions(+), 24 deletions(-) create mode 100644 apps/web/src/app/opengraph-image.tsx create mode 100644 apps/web/src/app/twitter-image.tsx diff --git a/apps/web/src/app/(home)/layout.tsx b/apps/web/src/app/(home)/layout.tsx index 77379fa..31e120b 100644 --- a/apps/web/src/app/(home)/layout.tsx +++ b/apps/web/src/app/(home)/layout.tsx @@ -1,5 +1,25 @@ import { HomeLayout } from 'fumadocs-ui/layouts/home'; import { baseOptions } from '@/lib/layout.shared'; +import type { Metadata } from 'next'; + +export const metadata: Metadata = { + title: '@deessejs/errors', + description: + 'A TypeScript library that brings Python-inspired error handling to JavaScript. Exception chaining, hierarchical inheritance, and rich error semantics through a function-based API.', + openGraph: { + title: '@deessejs/errors', + description: 'TypeScript error handling reimagined.', + url: '/', + siteName: 'DeesseJS Errors', + locale: 'en_US', + type: 'website', + }, + twitter: { + card: 'summary_large_image', + title: '@deessejs/errors', + description: 'TypeScript error handling reimagined.', + }, +}; export default function Layout({ children }: LayoutProps<'/'>) { return {children}; diff --git a/apps/web/src/app/(home)/page.tsx b/apps/web/src/app/(home)/page.tsx index 318a443..6d9f9d1 100644 --- a/apps/web/src/app/(home)/page.tsx +++ b/apps/web/src/app/(home)/page.tsx @@ -3,6 +3,7 @@ import type { Metadata } from 'next'; import { CodeBlock } from '@/components/code-block'; import { CtaCard } from '@/components/cta-card'; import { Footer } from '@/components/footer'; +import { baseUrl } from '@/lib/shared'; export const metadata: Metadata = { title: '@deessejs/errors — Error Handling, Reimagined', @@ -123,9 +124,34 @@ catch (err) { }`; export default function HomePage() { + const softwareJsonLd = { + '@context': 'https://schema.org', + '@type': 'SoftwareApplication', + name: '@deessejs/errors', + description: + 'TypeScript error handling library with exception chaining, hierarchical inheritance, and rich error semantics through a function-based API.', + url: baseUrl, + applicationCategory: 'DeveloperApplication', + operatingSystem: 'Node.js 18+', + programmingLanguage: { + '@type': 'ComputerLanguage', + name: 'TypeScript', + }, + license: 'MIT', + offers: { + '@type': 'Offer', + price: '0', + priceCurrency: 'USD', + }, + downloadUrl: 'https://www.npmjs.com/package/@deessejs/errors', + }; + return ( <> - {/* Blueprint grid background */} +