Skip to content

Add schema.org JSON-LD structured data - #2759

Open
AutomatedTester wants to merge 1 commit into
trunkfrom
structured-data
Open

Add schema.org JSON-LD structured data#2759
AutomatedTester wants to merge 1 commit into
trunkfrom
structured-data

Conversation

@AutomatedTester

@AutomatedTester AutomatedTester commented Aug 10, 2026

Copy link
Copy Markdown
Member

Description

Adds schema.org JSON-LD to every page, in the same head-end.html hook:

Page Type
Home WebSite
documentation/** TechArticle
blog/** BlogPosting

All three share one Organization publisher carrying the Selenium logo and the
project's sameAs profiles (GitHub, LinkedIn, X, YouTube). inLanguage is set
per page, so the translations describe themselves correctly rather than claiming
to be English. dateModified comes from .Lastmod; blog posts also get
datePublished and, where the front matter has one, an author.

description and author are merged in conditionally, so pages missing that
front matter emit valid JSON-LD without empty keys rather than "author": "".

Like the canonical link, this is skipped for the print output format.

Motivation and Context

Docsy calls Hugo's _internal/schema.html, which produces only sparse microdata —
not enough for search engines or AI crawlers to tell that a page is technical
reference documentation, which project publishes it, or when it was last updated.
TechArticle in particular is the signal that distinguishes our docs from blog
commentary about Selenium, which matters when both are competing for the same
query.

This pairs with the llms.txt index in #2757: that one states which pages
are canonical, this one describes what each page actually is.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

Built locally against Hugo Extended 0.148.2 (the version CI pins), on this branch
in isolation. Verified in the rendered output by parsing every emitted
<script type="application/ld+json"> block with a JSON parser rather than
eyeballing it:

Page Result
Home valid JSON, WebSite, inLanguage: en
/documentation/webdriver/ valid JSON, TechArticle, inLanguage: en, dateModified
/ja/documentation/webdriver/ valid JSON, TechArticle, inLanguage: ja
latest blog post valid JSON, BlogPosting, datePublished + dateModified
all 378 _print/ pages zero ld+json blocks, exactly one canonical

No empty-string values on any page, and the publisher carries the logo plus all 4
sameAs profiles. On the print pages the single canonical is Docsy's own
(<link rel="canonical" type="text/html" href=".../documentation/">) — pointing
back at the HTML page, as intended — confirming this hook correctly emits nothing
there.

Rebased onto trunk after #2758 merged, so this now contains only the JSON-LD
change (+51/-1). The rebase was clean: #2757 and #2758 were squash-merged, so this
branch's former parent was no longer an ancestor of trunk and GitHub reported a
conflict — but trunk's head-end.html is byte-identical to what #2758 merged, so
it was a history-shape artifact rather than a content disagreement.

The build above is against current trunk, which matters because #2757 added
llms as an alternative output format on the home page, and this hook derives
the current format by subtracting alternatives. Verified those coexist: the home
page still emits exactly one canonical and one ld+json block, and /llms.txt is
still generated with its 119 links.

🤖 Generated with Claude Code

Base automatically changed from canonical-hreflang to trunk August 10, 2026 17:14
@diemol

diemol commented Aug 10, 2026

Copy link
Copy Markdown
Member

@AutomatedTester can you please check the conflicts?

Docsy calls Hugo's _internal/schema.html, which emits only a handful of
sparse microdata meta tags. Search engines and retrieval systems get no
explicit signal about what kind of page they are looking at, who
publishes it, or when it was last updated.

Emits one JSON-LD block per page:

  - WebSite on the home page
  - TechArticle for documentation pages
  - BlogPosting for blog posts, with datePublished and author

All three carry an Organization publisher and inLanguage, so the four
language variants are described accurately. dateModified comes from
.Lastmod, which is already backed by git commit dates via enableGitInfo,
making freshness explicit rather than something a crawler has to guess.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit b675dfc
🔍 Latest deploy log https://app.netlify.com/projects/selenium-dev/deploys/6a7adde2430ecb00087157f0
😎 Deploy Preview https://deploy-preview-2759--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

2 participants