Skip to content

feat: structured data (JSON-LD) and metadata completeness#13

Merged
anurag629 merged 1 commit into
developfrom
feat/seo-structured-data
Jul 8, 2026
Merged

feat: structured data (JSON-LD) and metadata completeness#13
anurag629 merged 1 commit into
developfrom
feat/seo-structured-data

Conversation

@anurag629

Copy link
Copy Markdown
Member

What

Adds schema.org structured data and fills the remaining metadata gaps so search engines and AI answer engines can understand the site and each tool. Everything derives from the TOOLS registry, so the structured data can't drift from what renders.

Changes

New lib/jsonLd.ts — one home for all JSON-LD builders:

  • FAQPage from the registry FAQs. The FAQs were already written and rendered on the page, but nothing emitted the markup. Gated to tools that actually show an FAQ section (tool.faqs.length > 0), so json-formatter (no FAQs) emits none.
  • Organization + WebSite + ItemList @graph on the homepage, linked by @id (WebSite publisher references the Organization). The ItemList mirrors the visible tool grid in the same order.
  • BreadcrumbList on tool pages (Home > Tool). The current-page crumb omits item per Google's spec.
  • toolJsonLd (SoftwareApplication) moved here from lib/toolMetadata.ts.

components/shared/ToolPageLayout.tsx — emits the three JSON-LD blocks and renders a real visible Home > Tool breadcrumb, so the schema represents content the page actually shows (Google's structured-data policy). The heroBreadcrumb tagline is kept but moved outside the <nav>/<ol> so screen readers don't announce it as a third crumb, and the current crumb uses --fg (not the tool accent) to clear WCAG AA contrast in light mode.

Metadata completeness:

  • Homepage canonical (inherits the root OpenGraph rather than clobbering it via Next's shallow merge).
  • Root OpenGraph gains locale / title / description; Twitter gains site.
  • Per-tool OpenGraph gains siteName + locale.

Deliberately skipped (with reasons)

  • SearchAction / sitelinks searchbox on WebSite — there is no on-site search endpoint to point it at, and Google deprecated the sitelinks searchbox in 2024.
  • aggregateRating / review on SoftwareApplication — no accounts, no honest ratings; fabricating them violates Google policy and SoftwareApplication isn't a rich-result type anyway.
  • toolbelt repo URL in sameAssameAs is for the Organization's identity profiles (the GitHub org), not a content link.

How it was verified

  • Rendered-HTML inspection on home + json-formatter (no FAQ) + jwt-decoder (FAQ): every JSON-LD block parses as valid JSON; correct block sets per page; canonical + og:url + WebSite.url + breadcrumb Home item all consistent (https://tools.codercops.com, no trailing slash).
  • Adversarial 3-lens review (schema correctness, Next metadata, a11y). It caught two real breadcrumb issues (accent-crumb contrast + tagline announced as a crumb); both fixed in this PR.
  • npm run build, npm run lint, npm run test (27/27) pass.

Approach note

Recommendations were researched and adversarially fact-checked against current (2026) Google Search Central / schema.org / Next.js docs before implementing — notably that FAQ rich results are restricted since 2023 (we still emit valid FAQPage for other engines and AI, since the FAQ is genuinely visible) and that the sitelinks searchbox is gone.

Second PR in the SEO plan. Next: on-site GitHub link + live star count, then the README overhaul.

Add schema.org structured data and fill metadata gaps so search and AI
crawlers can understand the site and each tool.

- lib/jsonLd.ts (new): one home for all JSON-LD builders, each derived from
  the TOOLS registry so it can't drift from what renders.
  - FAQPage from the registry FAQs (the FAQs were already written but nothing
    emitted them); gated to pages that actually render an FAQ section
  - Organization + WebSite + ItemList @graph on the homepage, linked by @id
  - BreadcrumbList on tool pages (Home > Tool)
  - toolJsonLd (SoftwareApplication) moved here from lib/toolMetadata.ts
- ToolPageLayout: emit the three JSON-LD blocks and render a real visible
  Home > Tool breadcrumb (so the schema represents visible content). The
  heroBreadcrumb tagline sits outside the <nav> so it isn't announced as a
  crumb, and the current crumb uses --fg to clear WCAG AA contrast.
- Homepage: canonical, inheriting the root OpenGraph rather than clobbering it.
- Root metadata: OpenGraph locale/title/description and twitter:site.
- Per-tool OpenGraph gains siteName + locale.

Deliberately skipped: SearchAction/sitelinks searchbox (no site search;
deprecated in 2024), and any aggregateRating (no honest ratings to claim).

All JSON-LD verified as valid against the rendered HTML. build, lint, and
27 tests pass.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
toolbelt Ready Ready Preview, Comment Jul 8, 2026 8:44am

Request Review

@anurag629 anurag629 merged commit 4344140 into develop Jul 8, 2026
3 checks passed
@anurag629 anurag629 deleted the feat/seo-structured-data branch July 8, 2026 08:45
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