Skip to content

Conversation

@Jannih
Copy link

@Jannih Jannih commented Dec 12, 2025

Description

Closes #5443

Adds per-page JSON-LD structured data (Schema Markup) configuration in Page Settings with AI-powered generation.

Features:

  • New "Schema Markup" section in Page Settings
  • AI-powered schema generation using OpenAI GPT-5.1 with 18 schema.org types (Organization, Product, FAQ, Article, etc.)
  • JSON editor with syntax highlighting and validation
  • Duplicate singleton schema type warnings (e.g., warns if multiple Organization schemas on same page)
  • Renders JSON-LD scripts in published pages via <script type="application/ld+json">

Technical:

  • New schemaMarkup field in page meta schema
  • SchemaMarkup component for builder UI
  • PageSettingsSchemaMarkup component for runtime rendering
  • AI router with TRPC integration (requires OPENAI_KEY env variable)

Steps for reproduction

  1. Open Page Settings for any page
  2. Scroll to "Schema Markup" section
  3. Click "Generate with AI" and select a schema type (e.g., Organization)
  4. Verify JSON-LD is generated with page context (title, URL, etc.)
  5. Alternatively click "Add manually" to add empty template
  6. Publish the page
  7. Inspect the published page source - JSON-LD should appear in <head>

Code Review

  • hi @kof, I need you to do
    • conceptual review (architecture, feature-correctness)
    • detailed review (read every line)
    • test it on preview

Before requesting a review

  • made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")

Before merging

  • tested locally and on preview environment (preview dev login: 0000)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env file
    • OPENAI_KEY - Required for AI schema generation
    • OPENAI_ORG - Optional OpenAI organization ID

ai generated schema markup
fix type check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate schema markup with AI

1 participant