page-titles.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Single source of truth for page titles.
  3. * Used by both page metadata exports and the OG image route.
  4. *
  5. * Keys mirror the page's URL path (e.g., "docs/changelog" → /og/docs/changelog).
  6. * Values are display titles (without the "| json-render" suffix — the layout template adds that).
  7. */
  8. export const PAGE_TITLES: Record<string, string> = {
  9. // Home (no slug)
  10. "": "The Generative UI\nFramework",
  11. // Top-level
  12. playground: "Playground",
  13. // Docs
  14. docs: "Introduction",
  15. "docs/quick-start": "Quick Start",
  16. "docs/installation": "Installation",
  17. "docs/catalog": "Catalog",
  18. "docs/schemas": "Schemas",
  19. "docs/specs": "Specs",
  20. "docs/registry": "Registry",
  21. "docs/streaming": "Streaming",
  22. "docs/validation": "Validation",
  23. "docs/data-binding": "Data Binding",
  24. "docs/computed-values": "Computed Values",
  25. "docs/visibility": "Visibility",
  26. "docs/watchers": "Watchers",
  27. "docs/renderers": "Renderers",
  28. "docs/generation-modes": "Generation Modes",
  29. "docs/code-export": "Code Export",
  30. "docs/custom-schema": "Custom Schema & Renderer",
  31. "docs/ai-sdk": "AI SDK Integration",
  32. "docs/adaptive-cards": "Adaptive Cards Integration",
  33. "docs/openapi": "OpenAPI Integration",
  34. "docs/a2ui": "A2UI Integration",
  35. "docs/ag-ui": "AG-UI Integration",
  36. "docs/migration": "Migration Guide",
  37. "docs/changelog": "Changelog",
  38. "docs/skills": "Skills",
  39. // API references
  40. "docs/api/core": "@json-render/core API",
  41. "docs/api/react": "@json-render/react API",
  42. "docs/api/vue": "@json-render/vue API",
  43. "docs/api/react-pdf": "@json-render/react-pdf API",
  44. "docs/api/react-email": "@json-render/react-email API",
  45. "docs/api/react-native": "@json-render/react-native API",
  46. "docs/api/svelte": "@json-render/svelte API",
  47. "docs/api/codegen": "@json-render/codegen API",
  48. "docs/api/image": "@json-render/image API",
  49. "docs/api/remotion": "@json-render/remotion API",
  50. "docs/api/shadcn": "@json-render/shadcn API",
  51. "docs/api/mcp": "@json-render/mcp API",
  52. "docs/api/redux": "@json-render/redux API",
  53. "docs/api/zustand": "@json-render/zustand API",
  54. "docs/api/jotai": "@json-render/jotai API",
  55. "docs/api/xstate": "@json-render/xstate API",
  56. };
  57. /**
  58. * Get the page title for a given slug.
  59. * Returns null if the slug is not in the whitelist.
  60. */
  61. export function getPageTitle(slug: string): string | null {
  62. return slug in PAGE_TITLES ? PAGE_TITLES[slug]! : null;
  63. }