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
Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow just saw what you did here 😅

Problem is we haven't built the new AI integration yet and there needs to be:

  1. defined which provider we want to use, probably vercel gateway to have access to many models
  2. how payments are going to work, we can't just connect latest model for free for users, only a cheap model would be possible, not big latest LLM, otherwise it will potentially cost more than we get from users.
  3. Billing that we have implemented for inception along with a new login needs to be used for paying AI credits.

These are the thoughts so far. Please next time discuss in detail with us the feature to avoid building something we can't really merge yet.

@kof
Copy link
Member

kof commented Dec 16, 2025

MAybe for starters we could merge JSONLD editing without AI and put AI on the next step for this?

value: schemaMarkup,
});
}}
pageContext={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, you are not providing the entire page content, what am I missing?

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

2 participants