page-titles.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. examples: "Examples",
  14. // Docs
  15. docs: "Introduction",
  16. "docs/quick-start": "Quick Start",
  17. "docs/installation": "Installation",
  18. "docs/catalog": "Catalog",
  19. "docs/schemas": "Schemas",
  20. "docs/specs": "Specs",
  21. "docs/registry": "Registry",
  22. "docs/streaming": "Streaming",
  23. "docs/validation": "Validation",
  24. "docs/data-binding": "Data Binding",
  25. "docs/computed-values": "Computed Values",
  26. "docs/visibility": "Visibility",
  27. "docs/watchers": "Watchers",
  28. "docs/renderers": "Renderers",
  29. "docs/generation-modes": "Generation Modes",
  30. "docs/code-export": "Code Export",
  31. "docs/custom-schema": "Custom Schema & Renderer",
  32. "docs/ai-sdk": "AI SDK Integration",
  33. "docs/adaptive-cards": "Adaptive Cards Integration",
  34. "docs/openapi": "OpenAPI Integration",
  35. "docs/a2ui": "A2UI Integration",
  36. "docs/ag-ui": "AG-UI Integration",
  37. "docs/migration": "Migration Guide",
  38. "docs/changelog": "Changelog",
  39. "docs/skills": "Skills",
  40. // API references
  41. "docs/api/core": "@json-render/core API",
  42. "docs/api/react": "@json-render/react API",
  43. "docs/api/vue": "@json-render/vue API",
  44. "docs/api/solid": "@json-render/solid API",
  45. "docs/api/react-pdf": "@json-render/react-pdf API",
  46. "docs/api/react-email": "@json-render/react-email API",
  47. "docs/api/react-native": "@json-render/react-native API",
  48. "docs/api/svelte": "@json-render/svelte API",
  49. "docs/api/codegen": "@json-render/codegen API",
  50. "docs/api/image": "@json-render/image API",
  51. "docs/api/remotion": "@json-render/remotion API",
  52. "docs/api/shadcn": "@json-render/shadcn API",
  53. "docs/api/mcp": "@json-render/mcp API",
  54. "docs/api/redux": "@json-render/redux API",
  55. "docs/api/zustand": "@json-render/zustand API",
  56. "docs/api/jotai": "@json-render/jotai API",
  57. "docs/api/react-three-fiber": "@json-render/react-three-fiber API",
  58. "docs/api/xstate": "@json-render/xstate API",
  59. "docs/api/ink": "@json-render/ink API",
  60. "docs/api/yaml": "@json-render/yaml API",
  61. };
  62. /**
  63. * Get the page title for a given slug.
  64. * Returns null if the slug is not in the whitelist.
  65. */
  66. export function getPageTitle(slug: string): string | null {
  67. return slug in PAGE_TITLES ? PAGE_TITLES[slug]! : null;
  68. }