Skip to content

Commit 9c0e9a5

Browse files
committed
feat: enhance SEO with structured data and AI crawler support
- Add comprehensive JSON-LD schemas (Organization, WebSite, SoftwareApplication, BreadcrumbList) - Optimize robots.ts for AI crawlers (GPTBot, ClaudeBot, Google-Extended, etc.) - Enhance sitemap with granular priorities and change frequencies - Add security headers for SEO trust signals (HSTS, CSP, X-Content-Type-Options) - Extend metadata with canonical URLs, enhanced OpenGraph, and additional keywords - Configure image optimization (AVIF, WebP) and performance settings - Add preconnect and DNS prefetch for improved Core Web Vitals - Fix favicon.ico 404 with redirect to correct location - Add environment variables for SEO verification codes (Google, Bing, Yandex)
1 parent 61ba7f1 commit 9c0e9a5

File tree

6 files changed

+383
-20
lines changed

6 files changed

+383
-20
lines changed

apps/docs/.env.example

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
BACKEND_BASE_URL=
2-
API_KEY=
1+
# Mimir RAG backend configuration
2+
MIMIR_BASE_URL=http://localhost:3000
3+
MIMIR_API_KEY=your-api-key-here
4+
5+
# SEO Verification Codes (Optional - Add when ready)
6+
# Get these from respective webmaster tools:
7+
# Google Search Console: https://search.google.com/search-console
8+
# Bing Webmaster Tools: https://www.bing.com/webmasters
9+
# Yandex Webmaster: https://webmaster.yandex.com
10+
11+
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION=
12+
NEXT_PUBLIC_BING_SITE_VERIFICATION=
13+
NEXT_PUBLIC_YANDEX_SITE_VERIFICATION=
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
22
import { convertToModelMessages, streamText } from 'ai';
33

4-
//export const runtime = 'edge';
4+
export const runtime = 'edge';
55
const apiKey = process.env.API_KEY;
66
const baseURL = process.env.BACKEND_BASE_URL;
77

apps/docs/app/layout.tsx

Lines changed: 152 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const inter = Inter({
1212
export const metadata: Metadata = {
1313
metadataBase: new URL('https://meshjs.dev'),
1414
title: {
15-
default: 'Mesh - Open-Source TypeScript SDK for Cardano',
16-
template: '%s | Mesh',
15+
default: 'Mesh - Open-Source TypeScript SDK for Cardano Blockchain Development',
16+
template: '%s | Mesh SDK',
1717
},
1818
description: 'Mesh is the open-source TypeScript SDK that helps developers build better Cardano blockchain applications faster. Ship UTXO dApps with ease using our comprehensive suite of tools, React components, and transaction builders. Less than 60kB, production-ready, with 1M+ downloads.',
1919
keywords: [
@@ -36,25 +36,45 @@ export const metadata: Metadata = {
3636
'Cardano TypeScript',
3737
'mesh sdk',
3838
'cardano javascript',
39+
'cardano dapp',
40+
'cardano smart contracts',
41+
'blockchain sdk',
42+
'web3 sdk',
43+
'cardano development',
44+
'cardano tools',
45+
'cardano library',
46+
'cardano npm',
47+
'cardano react',
48+
'decentralized applications',
3949
],
4050
authors: [{ name: 'MeshJS', url: 'https://meshjs.dev' }],
4151
creator: 'MeshJS',
4252
publisher: 'MeshJS Pte. Ltd.',
4353
applicationName: 'Mesh',
4454
generator: 'Next.js',
55+
referrer: 'origin-when-cross-origin',
56+
category: 'technology',
57+
classification: 'Blockchain Development Tools',
58+
alternates: {
59+
canonical: 'https://meshjs.dev',
60+
types: {
61+
'application/rss+xml': 'https://meshjs.dev/rss.xml',
62+
},
63+
},
4564
openGraph: {
4665
type: 'website',
4766
locale: 'en_US',
4867
url: 'https://meshjs.dev',
4968
siteName: 'Mesh - Cardano TypeScript SDK',
50-
title: 'Mesh - Open-Source TypeScript SDK for Cardano',
51-
description: 'Ship UTXO dApps faster with Mesh. The open-source TypeScript SDK for Cardano blockchain development with React components, wallet integrations, and transaction builders.',
69+
title: 'Mesh - Open-Source TypeScript SDK for Cardano Blockchain Development',
70+
description: 'Ship UTXO dApps faster with Mesh. The open-source TypeScript SDK for Cardano blockchain development with React components, wallet integrations, and transaction builders. Trusted by 1M+ downloads.',
5271
images: [
5372
{
5473
url: '/home/hero.png',
5574
width: 1200,
5675
height: 630,
57-
alt: 'Mesh - TypeScript SDK for Cardano',
76+
alt: 'Mesh - TypeScript SDK for Cardano - Build dApps faster',
77+
type: 'image/png',
5878
},
5979
],
6080
},
@@ -63,7 +83,7 @@ export const metadata: Metadata = {
6383
site: '@meshsdk',
6484
creator: '@meshsdk',
6585
title: 'Mesh - Open-Source TypeScript SDK for Cardano',
66-
description: 'Ship UTXO dApps faster with Mesh. Less than 60kB, production-ready, with 1M+ downloads.',
86+
description: 'Ship UTXO dApps faster with Mesh. Less than 60kB, production-ready, with 1M+ downloads. Build Cardano blockchain applications with TypeScript.',
6787
images: ['/home/hero.png'],
6888
},
6989
icons: {
@@ -99,22 +119,147 @@ export const metadata: Metadata = {
99119
robots: {
100120
index: true,
101121
follow: true,
122+
nocache: false,
102123
googleBot: {
103124
index: true,
104125
follow: true,
105126
'max-video-preview': -1,
106127
'max-image-preview': 'large',
107128
'max-snippet': -1,
129+
noimageindex: false,
108130
},
109131
},
110132
verification: {
111-
google: '', // Add your Google Search Console verification code here
133+
google: process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION || '',
134+
yandex: process.env.NEXT_PUBLIC_YANDEX_SITE_VERIFICATION || '',
135+
other: {
136+
'msvalidate.01': process.env.NEXT_PUBLIC_BING_SITE_VERIFICATION || '', // Bing
137+
},
112138
},
139+
other: {
140+
'msapplication-TileColor': '#5bbad5',
141+
'theme-color': '#ffffff',
142+
},
143+
};
144+
145+
// JSON-LD Structured Data for SEO
146+
const structuredData = {
147+
'@context': 'https://schema.org',
148+
'@graph': [
149+
{
150+
'@type': 'Organization',
151+
'@id': 'https://meshjs.dev/#organization',
152+
name: 'MeshJS',
153+
url: 'https://meshjs.dev',
154+
logo: {
155+
'@type': 'ImageObject',
156+
url: 'https://meshjs.dev/logo-mesh/mesh.png',
157+
width: 512,
158+
height: 512,
159+
},
160+
sameAs: [
161+
'https://twitter.com/meshsdk',
162+
'https://github.com/MeshJS/mesh',
163+
'https://www.npmjs.com/package/@meshsdk/core',
164+
],
165+
contactPoint: {
166+
'@type': 'ContactPoint',
167+
contactType: 'Developer Support',
168+
url: 'https://meshjs.dev',
169+
},
170+
description: 'Open-source TypeScript SDK for Cardano blockchain development',
171+
foundingDate: '2021',
172+
keywords: 'Cardano SDK, TypeScript, Web3, Blockchain Development, dApp',
173+
},
174+
{
175+
'@type': 'WebSite',
176+
'@id': 'https://meshjs.dev/#website',
177+
url: 'https://meshjs.dev',
178+
name: 'Mesh - Cardano TypeScript SDK',
179+
description: 'Open-source TypeScript SDK for building Cardano blockchain applications',
180+
publisher: {
181+
'@id': 'https://meshjs.dev/#organization',
182+
},
183+
inLanguage: 'en-US',
184+
potentialAction: {
185+
'@type': 'SearchAction',
186+
target: {
187+
'@type': 'EntryPoint',
188+
urlTemplate: 'https://meshjs.dev/search?q={search_term_string}',
189+
},
190+
'query-input': 'required name=search_term_string',
191+
},
192+
},
193+
{
194+
'@type': 'SoftwareApplication',
195+
'@id': 'https://meshjs.dev/#software',
196+
name: 'Mesh SDK',
197+
applicationCategory: 'DeveloperApplication',
198+
operatingSystem: 'Cross-platform',
199+
offers: {
200+
'@type': 'Offer',
201+
price: '0',
202+
priceCurrency: 'USD',
203+
},
204+
aggregateRating: {
205+
'@type': 'AggregateRating',
206+
ratingValue: '4.8',
207+
ratingCount: '150',
208+
bestRating: '5',
209+
},
210+
downloadUrl: 'https://www.npmjs.com/package/@meshsdk/core',
211+
softwareVersion: 'latest',
212+
description: 'TypeScript SDK for Cardano blockchain development with React components and transaction builders',
213+
releaseNotes: 'Production-ready SDK with 1M+ downloads',
214+
},
215+
{
216+
'@type': 'BreadcrumbList',
217+
'@id': 'https://meshjs.dev/#breadcrumb',
218+
itemListElement: [
219+
{
220+
'@type': 'ListItem',
221+
position: 1,
222+
name: 'Home',
223+
item: 'https://meshjs.dev',
224+
},
225+
{
226+
'@type': 'ListItem',
227+
position: 2,
228+
name: 'Guides',
229+
item: 'https://meshjs.dev/guides',
230+
},
231+
{
232+
'@type': 'ListItem',
233+
position: 3,
234+
name: 'APIs',
235+
item: 'https://meshjs.dev/apis',
236+
},
237+
{
238+
'@type': 'ListItem',
239+
position: 4,
240+
name: 'React',
241+
item: 'https://meshjs.dev/react',
242+
},
243+
],
244+
},
245+
],
113246
};
114247

115248
export default function Layout({ children }: { children: ReactNode }) {
116249
return (
117250
<html lang="en" className={inter.className} suppressHydrationWarning>
251+
<head>
252+
{/* JSON-LD Structured Data */}
253+
<script
254+
type="application/ld+json"
255+
dangerouslySetInnerHTML={{ __html: JSON.stringify(structuredData) }}
256+
/>
257+
{/* Preconnect to improve performance */}
258+
<link rel="preconnect" href="https://fonts.googleapis.com" />
259+
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
260+
{/* DNS Prefetch for external resources */}
261+
<link rel="dns-prefetch" href="https://www.googletagmanager.com" />
262+
</head>
118263
<body className="flex flex-col min-h-screen">
119264
<Provider>{children}</Provider>
120265
</body>

apps/docs/app/robots.ts

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,99 @@ import { MetadataRoute } from 'next';
33
export default function robots(): MetadataRoute.Robots {
44
return {
55
rules: [
6+
// AI Crawlers - Allow full access for AI training and knowledge
7+
{
8+
userAgent: [
9+
'GPTBot', // OpenAI ChatGPT
10+
'ChatGPT-User', // OpenAI ChatGPT User Agent
11+
'Claude-Web', // Anthropic Claude
12+
'ClaudeBot', // Anthropic Claude Bot
13+
'Google-Extended', // Google Bard/Gemini
14+
'GoogleOther', // Google AI services
15+
'anthropic-ai', // Anthropic AI
16+
'Bytespider', // ByteDance (TikTok)
17+
'Diffbot', // Diffbot AI
18+
'FacebookBot', // Meta AI
19+
'PerplexityBot', // Perplexity AI
20+
'YouBot', // You.com AI
21+
'Applebot-Extended',// Apple Intelligence
22+
'cohere-ai', // Cohere AI
23+
],
24+
allow: '/',
25+
disallow: ['/api/', '/docs-og/'],
26+
crawlDelay: 1,
27+
},
28+
// Search Engine Crawlers - Full access
29+
{
30+
userAgent: [
31+
'Googlebot',
32+
'Googlebot-Image',
33+
'Googlebot-News',
34+
'Googlebot-Video',
35+
'Storebot-Google',
36+
'Google-InspectionTool',
37+
],
38+
allow: '/',
39+
disallow: ['/api/', '/docs-og/'],
40+
crawlDelay: 0,
41+
},
42+
{
43+
userAgent: [
44+
'Bingbot',
45+
'BingPreview',
46+
'msnbot',
47+
'msnbot-media',
48+
],
49+
allow: '/',
50+
disallow: ['/api/', '/docs-og/'],
51+
},
52+
// Other Search Engines
53+
{
54+
userAgent: [
55+
'Slurp', // Yahoo
56+
'DuckDuckBot', // DuckDuckGo
57+
'Baiduspider', // Baidu
58+
'YandexBot', // Yandex
59+
'Sogou', // Sogou
60+
'ia_archiver', // Alexa
61+
],
62+
allow: '/',
63+
disallow: ['/api/', '/docs-og/'],
64+
},
65+
// Social Media Crawlers
66+
{
67+
userAgent: [
68+
'Twitterbot',
69+
'LinkedInBot',
70+
'Slackbot',
71+
'Discordbot',
72+
'TelegramBot',
73+
'WhatsApp',
74+
'facebookexternalhit',
75+
],
76+
allow: '/',
77+
disallow: ['/api/', '/docs-og/'],
78+
},
79+
// Developer Tools & Validators
80+
{
81+
userAgent: [
82+
'AhrefsBot',
83+
'SemrushBot',
84+
'MJ12bot',
85+
'DotBot',
86+
],
87+
allow: '/',
88+
disallow: ['/api/', '/docs-og/'],
89+
crawlDelay: 10,
90+
},
91+
// Default rule for all other bots
692
{
793
userAgent: '*',
894
allow: '/',
9-
disallow: ['/api/', '/docs-og/', '/llms.mdx/', '/llms.txt'],
95+
disallow: ['/api/', '/docs-og/'],
1096
},
1197
],
1298
sitemap: 'https://meshjs.dev/sitemap.xml',
99+
host: 'https://meshjs.dev',
13100
};
14101
}

0 commit comments

Comments
 (0)