Skip to content

feat(seo): add structured data utilities#1

Merged
maitamdev merged 1 commit intomainfrom
feat/yolo-seo-utils
Mar 4, 2026
Merged

feat(seo): add structured data utilities#1
maitamdev merged 1 commit intomainfrom
feat/yolo-seo-utils

Conversation

@maitamdev
Copy link
Copy Markdown
Owner

@maitamdev maitamdev commented Mar 4, 2026

Add SEO structured data generation for better search engine indexing.


Summary by cubic

Add utilities to generate JSON-LD for SEO, including a generic builder and a breadcrumb schema helper to improve indexing.

  • New Features

    • generateStructuredData(type, data): returns a JSON string with @context and @type.
    • generateBreadcrumbSchema(items): creates a Schema.org BreadcrumbList with ordered items.
  • Migration

    • Inject the returned JSON into a script tag with type="application/ld+json" in the page head.

Written for commit 91aa33d. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Added SEO enhancements including structured data and breadcrumb schema support to improve search engine visibility and site navigation clarity.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dhv-guiding-light Building Building Preview, Comment Mar 4, 2026 7:00pm

@maitamdev maitamdev merged commit 1d5a6fe into main Mar 4, 2026
1 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9babcfec-97b5-41a5-bcb2-1f50586d003b

📥 Commits

Reviewing files that changed from the base of the PR and between 80377d9 and 91aa33d.

📒 Files selected for processing (1)
  • src/utils/seo.ts

📝 Walkthrough

Walkthrough

A new SEO utility module is added to the codebase, exporting two functions for generating JSON-LD structured data and breadcrumb schema markup to enhance search engine optimization.

Changes

Cohort / File(s) Summary
SEO Utilities
src/utils/seo.ts
Introduces generateStructuredData() for creating JSON-LD objects and generateBreadcrumbSchema() for generating breadcrumb markup from an array of navigation items.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through structured trails,
JSON-LD breadcrumbs mark the tales,
Schema spreads through the digital warren,
SEO shines with paths well-worn! 🍞✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/yolo-seo-utils

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/utils/seo.ts">

<violation number="1" location="src/utils/seo.ts:6">
P2: Prevent caller data from overriding `@context` and `@type` in generated schema.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/utils/seo.ts
type: string,
data: Record<string, unknown>,
): string {
const schema = { "@context": "https://schema.org", "@type": type, ...data };
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Mar 4, 2026

Choose a reason for hiding this comment

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

P2: Prevent caller data from overriding @context and @type in generated schema.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/utils/seo.ts, line 6:

<comment>Prevent caller data from overriding `@context` and `@type` in generated schema.</comment>

<file context>
@@ -0,0 +1,21 @@
+  type: string,
+  data: Record<string, unknown>,
+): string {
+  const schema = { "@context": "https://schema.org", "@type": type, ...data };
+  return JSON.stringify(schema);
+}
</file context>
Fix with Cubic

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.

1 participant