feat(seo): add Schema.org JSON-LD structured data - #757
Draft
dgaponov wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
На сайте не было структурированных данных вообще; три тега
itemPropвMeta.tsx— сироты безitemscope/itemtype, поисковики их игнорируют.Через новый опциональный проп
jsonLdуLayout(рендерится в существующий<head>):Organization+WebSiteSoftwareSourceCodeBreadcrumbList+TechArticleКрошки локализованы и по названиям, и по URL:
/ruотдаётКомпоненты > UIKit > Button.Намеренно не добавлено:
HowTo(устарел),FAQPage(Google убрал сниппеты),SearchAction(поиска по сайту нет), даты уTechArticle(нет достоверного источника), npm-организация вsameAs(не проверяется и не связана с сайтом).После выката стоит прогнать Rich Results Test — вердикт по крошкам даёт только он.
🤖 Generated with Claude Code