Skip to content

feat: link docs pages to the Vaadin entity graph in JSON-LD - #6802

Merged
peholmst merged 5 commits into
mainfrom
feat/dspublisher-structured-data
Dec 2, 2026
Merged

peholmst merged 5 commits into
mainfrom
feat/dspublisher-structured-data

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Configures the JSON-LD structured data that Design System Publisher adds to each docs article, so that each page links to the Vaadin entity graph used on vaadin.com, and documents the new structuredData option.

Production builds from the docs-app default branch, which already supports the option, so it takes effect on the first production deploy after this is merged. Local development and the PR preview use the pinned DSP release (DSP_VERSION in dspublisher/dspublisher-scripts.js and the build in Dockerfile.preview), and get the structured data once those are bumped to a release that includes it.

What changed

  • dspublisher/config/default.json:
    • Docs WebSite node https://vaadin.com/docs/#website, with URL https://vaadin.com/docs/latest/, part of https://vaadin.com/#website and published by https://vaadin.com/#organization.
    • about by path, the longest match wins:
      • /components: https://vaadin.com/components#software
      • /tools/copilot: https://vaadin.com/copilot#software
      • /flow/react-views: https://vaadin.com/hilla#software
      • /flow/testing: https://vaadin.com/testbench#software
      • other pages under /flow: https://vaadin.com/framework#software
      • all other pages: https://vaadin.com/#software
  • DSP configuration page: new structuredData option and section, the canonicalUrl version property that the data depends on, and a note that dateModified needs a full Git clone.
  • No /hilla mapping: every /hilla path is a redirect now, so no page would match it. The React views pages, where that content now lives, are about Hilla instead.

Test summary

  • Built the DSP test site with an equivalent configuration and checked the generated JSON-LD.
  • Vale reports no findings on the changed lines.

Working on behalf of Petter

Configure the structured data that Design System Publisher adds to each
article page: the docs WebSite node, which is part of the main
vaadin.com website and published by the Vaadin organization, and the
product each page is about, by path. Pages under /flow are about Vaadin
Flow, pages under /hilla about Hilla, and all other pages about the
Vaadin platform.

Also document the new structuredData option in the DSP configuration
page. The option takes effect once the pinned DSP version includes it.
No article lives under /hilla any more, as all /hilla paths redirect to
other sections, so the mapping never matched a page. Also document the
canonicalUrl version property, which structured data depends on, and
list structuredData in the default configuration.
@totally-not-ai totally-not-ai Bot added the target/v25.3 Automatically cherry-pick to the v25.3 branch label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-6802.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 19fd64f

Comment thread dspublisher/config/default.json Outdated
},
"about": {
"/": "https://vaadin.com/#software",
"/flow": "https://vaadin.com/flow#software"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://vaadin.com/flow#software doesn't seem to exist in the vaadin.com graph. https://vaadin.com/flow redirects (301) to https://vaadin.com/framework, and that page defines the Flow entity as https://vaadin.com/framework#software. As written, the pages under /flow would point at an @id that nothing defines. Should this be https://vaadin.com/framework#software?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, good catch. vaadin.com/flow redirects to vaadin.com/framework, and that page's JSON-LD defines https://vaadin.com/framework#software. Nothing defines https://vaadin.com/flow#software. I changed the /flow mapping to https://vaadin.com/framework#software and updated the PR description.

vaadin.com/flow redirects to vaadin.com/framework, which defines the
Flow entity as https://vaadin.com/framework#software. Nothing defines
https://vaadin.com/flow#software.
@peholmst
peholmst marked this pull request as ready for review December 1, 2026 12:59

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the changes — left 1 comment and collected 1 finding below that could not be attached to the diff.

Finding
💬 The first two sentences of the Structured Data section contradict each other
⚠️ The pending DSP version bump has to cover a second pin

⚠️ The pending DSP version bump has to cover a second pin
The PR description names only DSP_VERSION in dspublisher/dspublisher-scripts.js. The DSP version is pinned a second time here:

RUN DOCS_PREVIEW_DIFF=true DOCS_SITE_URL="$DOCS_SITE_URL" npx -y @vaadin/dspublisher@3.0.0-alpha.15 --build

If only dspublisher-scripts.js is bumped, the preview deployment keeps building with the old release, and the new structuredData option stays inert exactly where reviewers would look for it.
Dockerfile.preview:41 · accuracy

[[structured-data]]
== Structured Data

Each article page has JSON-LD structured data in its `<head>`: the article, with its title, description, canonical URL and last modified date, and the breadcrumb trail of the page. It's added only to pages that have a canonical URL, which needs a `canonicalUrl` for the version and, if that's relative, the `siteUrl`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 The first two sentences of the Structured Data section contradict each other

Each article page has JSON-LD structured data in its <head> … It's added only to pages that have a canonical URL, which needs a canonicalUrl for the version and, if that's relative, the siteUrl.

Sentence one says every article page has the data; sentence two takes it back. The condition is also stacked into one clause, so the reader has to unpack two dependencies at once.

Suggested rewrite:

An article page gets JSON-LD structured data in its <head> when the page has a canonical URL. The canonical URL comes from the canonicalUrl of the version, and from siteUrl when that value is relative. The data contains:

  • the article, with its title, description, canonical URL and last modified date
  • the breadcrumb trail of the page

configuration.adoc:136 · clarity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rewrote the opening as suggested: the canonical URL condition comes first, then where the URL comes from, and the contents are now a bulleted list.

@totally-not-ai

totally-not-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Dockerfile.preview pins the DSP version too. The PR description now says the pending bump covers both DSP_VERSION in dspublisher/dspublisher-scripts.js and the build in Dockerfile.preview. Both stay at the current version for now, because no DSP release includes the structuredData support yet.

@freducom

freducom commented Dec 1, 2026

Copy link
Copy Markdown

I checked the config against the live JSON-LD on vaadin.com, including the product entities added to the vaadin.com pages on 2026-11-30. Every @id the PR uses exists and matches: https://vaadin.com/#organization, https://vaadin.com/#website, https://vaadin.com/#software and https://vaadin.com/framework#software. The PR refers to them only by @id, so the names can't drift.

Two suggestions:

1. The website url redirects. https://vaadin.com/docs/ returns a 302 to https://vaadin.com/docs/latest/. A WebSite URL should point to a page that loads directly:

"url": "https://vaadin.com/docs/latest/",

The @id (https://vaadin.com/docs/#website) can stay as it is, since it's only an identifier.

2. More specific about targets now exist. vaadin.com defines a SoftwareApplication for each of these products, each part of https://vaadin.com/#software. Their docs sections currently fall back to the generic #software:

Entity Docs section
https://vaadin.com/components#software (Vaadin UI Components) /components
https://vaadin.com/copilot#software (Vaadin Copilot) /tools/copilot
https://vaadin.com/hilla#software (Hilla) /flow/react-views (where the /hilla pages redirect to)
https://vaadin.com/testbench#software (Vaadin TestBench) /flow/testing
"about": {
  "/": "https://vaadin.com/#software",
  "/flow": "https://vaadin.com/framework#software",
  "/flow/react-views": "https://vaadin.com/hilla#software",
  "/flow/testing": "https://vaadin.com/testbench#software",
  "/components": "https://vaadin.com/components#software",
  "/tools/copilot": "https://vaadin.com/copilot#software"
}

Components and Copilot are clear-cut. The React views and testing lines are judgement calls, since both sections are under Flow. Control Center also has an entity (https://vaadin.com/control-center#software), but its docs exist only in v24, so it doesn't apply on main.

One more thing to confirm: live docs pages already output TechArticle and BreadcrumbList JSON-LD, but the latest DSP release (3.0.0-alpha.16) doesn't contain that code. Production seems to build from newer docs-app code than the pinned DSP_VERSION. If so, structuredData takes effect on the first production deploy after this PR merges, with or without the version bump.

@tomivirkki

Copy link
Copy Markdown
Member

Production seems to build from newer docs-app code than the pinned DSP_VERSION

That's correct, production is always built from docs-app master. The DSP releases are mainly needed for local development purposes

Pages under /components, /tools/copilot, /flow/react-views and
/flow/testing are now about the UI Components, Copilot, Hilla and
TestBench entities that vaadin.com defines. The docs website URL points
to /docs/latest/, since /docs/ redirects there.
@totally-not-ai

totally-not-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@freducom Thanks, applied both suggestions.

  • The website url is now https://vaadin.com/docs/latest/. The @id stays https://vaadin.com/docs/#website.
  • I added all four about mappings as you proposed: /components, /tools/copilot, /flow/react-views (Hilla) and /flow/testing (TestBench). The longest matching path wins, so the two /flow/... entries take precedence over /flow. I checked that each @id is defined on its vaadin.com page and that each docs section exists.

@tomivirkki Thanks for confirming. The PR description now says that production picks this up on the first deploy after merge, and that the DSP version bump is only needed for local development and the PR preview.

@peholmst
peholmst merged commit ad6e851 into main Dec 2, 2026
11 checks passed
@peholmst
peholmst deleted the feat/dspublisher-structured-data branch December 2, 2026 06:50
peholmst pushed a commit that referenced this pull request Dec 2, 2026
…CP: v25.3) (#6818)

Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked-v25.3 target/v25.3 Automatically cherry-pick to the v25.3 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants