page-titles.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. // API references
  39. "docs/api/core": "@json-render/core API",
  40. "docs/api/react": "@json-render/react API",
  41. "docs/api/vue": "@json-render/vue API",
  42. "docs/api/react-pdf": "@json-render/react-pdf API",
  43. "docs/api/react-email": "@json-render/react-email API",
  44. "docs/api/react-native": "@json-render/react-native API",
  45. "docs/api/svelte": "@json-render/svelte API",
  46. "docs/api/codegen": "@json-render/codegen API",
  47. "docs/api/image": "@json-render/image API",
  48. "docs/api/remotion": "@json-render/remotion API",
  49. "docs/api/shadcn": "@json-render/shadcn API",
  50. "docs/api/mcp": "@json-render/mcp API",
  51. };
  52. /**
  53. * Get the page title for a given slug.
  54. * Returns null if the slug is not in the whitelist.
  55. */
  56. export function getPageTitle(slug: string): string | null {
  57. return slug in PAGE_TITLES ? PAGE_TITLES[slug]! : null;
  58. }