Skip to content
8 changes: 4 additions & 4 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export default function middleware(request: Request): Response {
}

if (decision.action === "html") {
// Sunset pages keep their URL but are left out of Markdown output.
const headers: Record<string, string> = isSunsetDocsPath(url.pathname)
? { "X-Robots-Tag": "noindex, follow" }
: { Link: `<${decision.alternatePath}>; rel="alternate"; type="text/markdown"` }
const headers: Record<string, string> = {
Link: `<${decision.alternatePath}>; rel="alternate"; type="text/markdown"`,
...(isSunsetDocsPath(url.pathname) ? { "X-Robots-Tag": "noindex, follow" } : {}),
}
return next({ headers })
}

Expand Down
8 changes: 8 additions & 0 deletions public/any-api/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Any API — Deprecated

Any API is deprecated. Use Chainlink Runtime Environment (CRE) instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink Runtime Environment (CRE) documentation](https://docs.chain.link/cre.md)
- [Chainlink Runtime Environment (CRE) documentation index](https://docs.chain.link/cre/llms.txt)
8 changes: 8 additions & 0 deletions public/chainlink-automation/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Chainlink Automation — Deprecated

Chainlink Automation is deprecated. Use Chainlink Runtime Environment (CRE) instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink Runtime Environment (CRE) documentation](https://docs.chain.link/cre.md)
- [Chainlink Runtime Environment (CRE) documentation index](https://docs.chain.link/cre/llms.txt)
8 changes: 8 additions & 0 deletions public/chainlink-functions/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Chainlink Functions — Deprecated

Chainlink Functions is deprecated. Use Chainlink Runtime Environment (CRE) instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink Runtime Environment (CRE) documentation](https://docs.chain.link/cre.md)
- [Chainlink Runtime Environment (CRE) documentation index](https://docs.chain.link/cre/llms.txt)
4 changes: 2 additions & 2 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Use the product-level `llms-full.txt` bundles listed below only when broad produ
Defaults:
- Prefer CRE for new multi-step, offchain, or automation workflows unless another product is explicitly required
- Prefer VRF v2.5 for randomness
- Treat Any API and `/chainlink-nodes/v1/` as legacy
- Do not retrieve Chainlink Functions or Chainlink Automation pages. Those products are sunset. Their HTML URLs still resolve, and this index does not list them.
- Treat `/chainlink-nodes/v1/` as legacy
- Any API, Chainlink Functions, and Chainlink Automation are deprecated. Their Markdown pages and product indexes contain deprecation notices directing you to CRE.


## Core Documentation
Expand Down
8 changes: 8 additions & 0 deletions public/vrf/v1/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Chainlink VRF v1 — Deprecated

Chainlink VRF v1 is deprecated. Use Chainlink VRF v2.5 instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink VRF v2.5 documentation](https://docs.chain.link/vrf/v2-5/migration-from-v1.md)
- [Chainlink VRF v2.5 documentation index](https://docs.chain.link/vrf/llms.txt)
8 changes: 8 additions & 0 deletions public/vrf/v2/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Chainlink VRF v2 — Deprecated

Chainlink VRF v2 is deprecated. Use Chainlink VRF v2.5 instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink VRF v2.5 documentation](https://docs.chain.link/vrf/v2-5/migration-from-v2.md)
- [Chainlink VRF v2.5 documentation index](https://docs.chain.link/vrf/llms.txt)
8 changes: 8 additions & 0 deletions src/config/llms.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SUNSET_DOC_ROOTS } from "./sunset.js"

export type LlmsSectionConfig = {
root: string
includeGlobs: string[]
Expand All @@ -9,6 +11,7 @@ export type LlmsSectionConfig = {

// Central list of sections that expose llms-full.txt or llms-full-[lang].txt
export const SUPPORTED_LLM_SECTIONS = [
...SUNSET_DOC_ROOTS,
"ace",
"cre",
"crec",
Expand All @@ -29,6 +32,11 @@ export type SupportedSection = (typeof SUPPORTED_LLM_SECTIONS)[number]

// Configuration for each section
export const LLM_SECTIONS_CONFIG: Record<SupportedSection, LlmsSectionConfig> = {
"any-api": { root: "src/content/any-api", includeGlobs: ["**/*.mdx"] },
"chainlink-automation": { root: "src/content/chainlink-automation", includeGlobs: ["**/*.mdx"] },
"chainlink-functions": { root: "src/content/chainlink-functions", includeGlobs: ["**/*.mdx"] },
"vrf/v1": { root: "src/content/vrf/v1", includeGlobs: ["**/*.mdx"] },
"vrf/v2": { root: "src/content/vrf/v2", includeGlobs: ["**/*.mdx"] },
ace: {
root: "src/content/ace",
includeGlobs: ["**/*.mdx"],
Expand Down
40 changes: 39 additions & 1 deletion src/config/sunset.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Sunset pages stay reachable at their old URLs.
* Site menus, search, and Markdown output leave them out.
* Site menus and search leave them out. Markdown output contains deprecation notices only.
* Functions and Automation pages still show the left sidebar from SIDEBAR_WITH_SUNSET_PRODUCTS.
* VRF v1 and VRF v2 pages still show the legacy left sidebar, including the v2.5 migration links.
* Pages send noindex. They stay in the sitemap so a crawler can recrawl and see noindex.
Expand All @@ -17,6 +17,44 @@ export const SUNSET_PAGES_STAY_IN_SITEMAP = true

export const SUNSET_DOC_ROOTS = ["any-api", "chainlink-automation", "chainlink-functions", "vrf/v1", "vrf/v2"] as const

type SunsetReplacement = { name: string; replacement: string; docsPath: string; indexPath: string }

const CRE_REPLACEMENT = {
replacement: "Chainlink Runtime Environment (CRE)",
docsPath: "cre",
indexPath: "cre/llms.txt",
}

export const SUNSET_REPLACEMENTS: Record<(typeof SUNSET_DOC_ROOTS)[number], SunsetReplacement> = {
"any-api": { name: "Any API", ...CRE_REPLACEMENT },
"chainlink-automation": { name: "Chainlink Automation", ...CRE_REPLACEMENT },
"chainlink-functions": { name: "Chainlink Functions", ...CRE_REPLACEMENT },
"vrf/v1": {
name: "Chainlink VRF v1",
replacement: "Chainlink VRF v2.5",
docsPath: "vrf/v2-5/migration-from-v1",
indexPath: "vrf/llms.txt",
},
"vrf/v2": {
name: "Chainlink VRF v2",
replacement: "Chainlink VRF v2.5",
docsPath: "vrf/v2-5/migration-from-v2",
indexPath: "vrf/llms.txt",
},
}

/** Uses the same sunset scope as menus/search; replacement metadata never marks a new page deprecated. */
export function getSunsetReplacement(pathname: string): SunsetReplacement | null {
const clean = normalizeDocsPath(pathname)
if (!isSunsetDocsPath(clean)) return null
const root = SUNSET_DOC_ROOTS.find((root) => clean === root || clean.startsWith(`${root}/`))
if (root) return SUNSET_REPLACEMENTS[root]
if (clean === "quickstarts/chainlink-demo-app" || clean === "quickstarts/vrf-enabled-lootbox-pack") {
return { ...SUNSET_REPLACEMENTS["vrf/v2"], name: "This VRF v2 example" }
}
return { name: "This legacy documentation", ...CRE_REPLACEMENT }
}

export const SUNSET_SIDEBAR_SECTIONS = ["automation", "chainlinkFunctions"] as const

/** Subtrees inside a product that stays in the menu. */
Expand Down
8 changes: 8 additions & 0 deletions src/content/any-api/llms-full.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Any API — Deprecated

Any API is deprecated. Use Chainlink Runtime Environment (CRE) instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink Runtime Environment (CRE) documentation](https://docs.chain.link/cre.md)
- [Chainlink Runtime Environment (CRE) documentation index](https://docs.chain.link/cre/llms.txt)
8 changes: 8 additions & 0 deletions src/content/any-api/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Any API — Deprecated

Any API is deprecated. Use Chainlink Runtime Environment (CRE) instead.

For new development, use the replacement documentation. Do not use the deprecated product's APIs, code examples, or setup instructions.

- [Chainlink Runtime Environment (CRE) documentation](https://docs.chain.link/cre.md)
- [Chainlink Runtime Environment (CRE) documentation index](https://docs.chain.link/cre/llms.txt)
Loading
Loading