Files
copilotkit__copilotkit/showcase/shell-docs/.env.example
Sam Julien aa65c89213 feat(shell-docs): add sitemap, robots, and per-framework self-canonical metadata
Phase 3 of the docs.copilotkit.ai cutover: surface a complete sitemap,
basic robots config, and per-framework self-canonical metadata so each
URL variant (bare /quickstart, /langgraph-python/quickstart,
/agno/quickstart, etc.) is indexed under its own canonical rather than
collapsing onto a single root.

- src/app/sitemap.ts: emit one entry per (root URL, framework variant)
  pair plus reference and AG-UI sections. lastModified resolves from
  MDX frontmatter `lastmod`, then file mtime, then now. Strips Next.js
  route-group `(name)` segments and trailing `/index` so URLs match
  what the routers actually serve.
- src/app/robots.ts: allow all, disallow /api/, sitemap pointer at
  ${NEXT_PUBLIC_BASE_URL}/sitemap.xml.
- src/lib/sitemap-helpers.ts: shared MDX walking + base-URL resolution
  used by both metadata routes.
- generateMetadata() on the four catch-all docs routes
  ([[...slug]], [framework]/[[...slug]], reference/[...slug],
  ag-ui/[[...slug]]) sets `alternates.canonical` to the page's own
  full URL. Per-framework self-canonical, NOT root canonical.
- .env.example: document NEXT_PUBLIC_BASE_URL and NEXT_PUBLIC_SHELL_URL.
- next.config.ts: extend the existing NEXT_PUBLIC_BASE_URL doc comment
  with the new sitemap/robots/canonical consumers.
2026-05-07 09:55:33 -07:00

17 lines
760 B
Bash

# shell-docs environment variables.
#
# Both NEXT_PUBLIC_* values below are required for `next build`
# (next.config.ts throws when either is missing during a production
# build). In dev, missing values fall back to localhost defaults so
# you can run `next dev` without a .env.local.
# Canonical base URL used by sitemap.ts, robots.ts, and the per-page
# canonical metadata. In production this points at the docs host so
# crawlers index every framework variant at its self-canonical URL.
NEXT_PUBLIC_BASE_URL=https://docs.copilotkit.ai
# URL of the showcase shell host, which owns /integrations and /matrix.
# Used by the top-nav cross-host links and InlineDemo. Replace with your
# deployment's shell host.
NEXT_PUBLIC_SHELL_URL=https://www.copilotkit.ai