Skip to content

feat(seo): add Schema.org JSON-LD structured data - #757

Draft
dgaponov wants to merge 1 commit into
mainfrom
seo/structured-data
Draft

feat(seo): add Schema.org JSON-LD structured data#757
dgaponov wants to merge 1 commit into
mainfrom
seo/structured-data

Conversation

@dgaponov

@dgaponov dgaponov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

На сайте не было структурированных данных вообще; три тега itemProp в Meta.tsx — сироты без itemscope/itemtype, поисковики их игнорируют.

Через новый опциональный проп jsonLd у Layout (рендерится в существующий <head>):

Страница Разметка
Главная Organization + WebSite
Библиотека SoftwareSourceCode
Компонент / гайдлайн BreadcrumbList + TechArticle

Крошки локализованы и по названиям, и по URL: /ru отдаёт Компоненты > UIKit > Button.

Намеренно не добавлено: HowTo (устарел), FAQPage (Google убрал сниппеты), SearchAction (поиска по сайту нет), даты у TechArticle (нет достоверного источника), npm-организация в sameAs (не проверяется и не связана с сайтом).

После выката стоит прогнать Rich Results Test — вердикт по крошкам даёт только он.

🤖 Generated with Claude Code

The site had no structured data at all. The three itemProp tags in
Meta.tsx are orphaned Microdata with no parent itemscope/itemtype, so
search engines ignore them entirely.

Adds, via a new optional `jsonLd` prop on Layout so everything renders
inside the existing <head> rather than a second one:

- Organization + WebSite on the homepage only, since they describe the
  site as a whole rather than each page
- SoftwareSourceCode on library pages
- BreadcrumbList + TechArticle on component and design guideline pages

Breadcrumb URLs and names are locale-aware: they use
getCanonicalUrlForLocale and the same translations the navigation uses,
so /ru pages emit "Компоненты > UIKit > Button" pointing at /ru URLs.

Deliberate omissions:
- HowTo: deprecated since September 2023.
- FAQPage: Google retired FAQ rich results in May 2026.
- WebSite.potentialAction/SearchAction: the site has no search endpoint,
  so declaring one would describe something that does not exist.
- datePublished/dateModified on TechArticle: readme content is fetched
  from GitHub raw URLs, which carry no reliable authoring date, and an
  invented date is worse than none.
- The npm organisation in sameAs: not linked from the site and could not
  be verified. The GitHub, Telegram and Figma URLs are the ones the site
  itself links to.

Two details differ from the audit's proposal, which assumed fields that
do not exist: LibConfig has no `description` (the library meta
description from i18n is used instead) and no plain `githubUrl` (it has
`githubId`, e.g. "gravity-ui/uikit").

Verified against a production build: JSON-LD is present and parses on
homepage, library, component and design pages in en and ru, absent where
nothing applies, and all page types return 200. Build, lint and typecheck
pass. Run Google's Rich Results Test after deploy to confirm breadcrumb
eligibility. E2E not run - Playwright browsers are not installed locally.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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