Skip to content

Commit bfc029b

Browse files
committed
feat: improve AI documentation discoverability
- Add <link rel="llms-txt" href="/llms.txt"> to the <head> of every page so any LLM fetching any page can discover the machine-readable docs - Add /.well-known/llms.txt -> /llms.txt permanent redirect in vercel.json (the emerging standard path for llms.txt discovery) - Add /en and /en/:path* -> / and /:path* permanent redirects at CDN level so old /en/build-style URLs no longer 404 (saves LLM agents a round-trip) - Add MCP server mention to llms.txt via starlightLlmsTxt details option ("For AI coding tools, install @aptos-labs/aptos-mcp")
1 parent 7d823af commit bfc029b

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

astro.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,15 @@ export default defineConfig({
155155
rawContent: true,
156156
description:
157157
"Developer documentation for the Aptos blockchain — Move smart contracts, SDKs, APIs, indexer, node operations, and AI tools.",
158+
details: [
159+
"For AI coding tools, install the Aptos MCP server: `npx @aptos-labs/aptos-mcp`",
160+
"It gives your IDE direct access to Aptos APIs, on-chain data, and Move contract helpers.",
161+
"See <https://aptos.dev/build/ai> for setup guides (Claude Code, Cursor, and more).",
162+
].join("\n"),
158163
optionalLinks: [
159164
{
160165
label: "Aptos MCP Server",
161-
url: "https://www.npmjs.com/package/@anthropic-ai/aptos-mcp",
166+
url: "https://www.npmjs.com/package/@aptos-labs/aptos-mcp",
162167
description: "MCP server for AI coding tools",
163168
},
164169
{

src/starlight-overrides/Head.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ const breadcrumbItems = [
149149
{/* Critical CSS with high fetch priority */}
150150
<link rel="preload" href={globalCssUrl} as="style" fetchpriority="high" />
151151

152+
{/* LLMs.txt discovery: lets any LLM fetching any page find the machine-readable docs */}
153+
<link rel="llms-txt" href="/llms.txt" />
154+
152155
{/* hreflang x-default: tells search engines which URL to serve when no locale matches */}
153156
<link rel="alternate" hreflang="x-default" href={getLanguageUrl("en")} />
154157

vercel.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@
2424
}
2525
],
2626
"redirects": [
27+
{
28+
"source": "/.well-known/llms.txt",
29+
"destination": "/llms.txt",
30+
"permanent": true
31+
},
32+
{
33+
"source": "/en",
34+
"destination": "/",
35+
"permanent": true
36+
},
37+
{
38+
"source": "/en/:path*",
39+
"destination": "/:path*",
40+
"permanent": true
41+
},
2742
{
2843
"source": "/tutorials/:path*",
2944
"destination": "/build/guides/:path*",

0 commit comments

Comments
 (0)