Skip to content

feat(seo): add BlogPosting JSON-LD structured data to blog posts#2018

Merged
Baoyuantop merged 1 commit intoapache:masterfrom
moonming:fix/schema-structured-data
Apr 13, 2026
Merged

feat(seo): add BlogPosting JSON-LD structured data to blog posts#2018
Baoyuantop merged 1 commit intoapache:masterfrom
moonming:fix/schema-structured-data

Conversation

@moonming
Copy link
Copy Markdown
Member

@moonming moonming commented Apr 9, 2026

Summary

  • Adds BlogPosting JSON-LD structured data to every blog post page, enabling Google rich results (article snippets, author info, publish dates)
  • Injects the schema via <script type="application/ld+json"> inside the existing <Seo> (react-helmet) component in BlogPostPage
  • Uses metadata already available in the component (title, description, date, authors, tags, image, permalink) — no new data sources needed

What's included in the JSON-LD

Field Source
headline metadata.title
description metadata.description
datePublished metadata.date (ISO 8601)
image assets.image or frontMatter.image
author[] metadata.authors (name, url, imageURL)
keywords metadata.tags labels, comma-separated
publisher Static: Apache APISIX organization + logo
mainEntityOfPage metadata.permalink

Why

Blog posts currently only have microdata attributes (itemType, itemProp) on HTML elements. Google strongly prefers JSON-LD for structured data, and BlogPosting schema enables rich results like:

  • Article snippets with author photo and publish date
  • Better visibility in Google Discover
  • Enhanced appearance in News results

Files changed

  • blog/src/theme/BlogPostPage/index.tsx — added JSON-LD script tag inside <Seo> component

Since blog/src/ is shared between blog/en/ and blog/zh/ (copied at build time), this change applies to both English and Chinese blog posts.

Add structured data (JSON-LD) for BlogPosting schema to every blog post
page. This helps search engines understand blog content and enables rich
results (article snippets, author info, publish date) in SERPs.

The JSON-LD includes:
- headline, description, datePublished
- author(s) with name, url, and image
- featured image when available
- article tags as keywords
- publisher (Apache APISIX organization)
- mainEntityOfPage linking to the canonical URL
Copilot AI review requested due to automatic review settings April 9, 2026 23:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Baoyuantop Baoyuantop merged commit 3925efe into apache:master Apr 13, 2026
11 checks passed
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.

4 participants