Skip to content

[MM-15278] feat(seo): emit VideoObject JSON-LD on doc pages with video#2274

Open
pauloSF0 wants to merge 2 commits into
mainfrom
MM-15278-feat/video-schema-org-indexing
Open

[MM-15278] feat(seo): emit VideoObject JSON-LD on doc pages with video#2274
pauloSF0 wants to merge 2 commits into
mainfrom
MM-15278-feat/video-schema-org-indexing

Conversation

@pauloSF0

Copy link
Copy Markdown
Contributor

Related issue

Google Search Console warning: "Either 'contentUrl' or 'embedUrl' should be specified" — videos not being indexed.

Changes

This PR emits a schema.org VideoObject JSON-LD on the 23 documentation pages that embed a YouTube video, so Google can index them and enable rich results. It fixes the GSC contentUrl/embedUrl warning.

The logic replicates the getVideoObjectSchema() approach already shipped in azion/site (learning/blog pages), adapted to this repo's Astro architecture:

  • uses embedUrl (never contentUrl);
  • derives thumbnailUrl from the YouTube ID (https://i.ytimg.com/vi/{ID}/hqdefault.jpg);
  • uses the page date as uploadDate;
  • omits duration.

Core changes:

  • src/util/videoObject.ts (new): getVideoObjectSchema() builder.
  • src/content/config.ts: added an optional video object (embedUrl + optional title/description/uploadDate/thumbnailUrl) to baseSchema. The embed is sourced explicitly from frontmatter instead of parsing the page body.
  • src/components/HeadSEO.astro: emits <script type="application/ld+json"> with the VideoObject only when the page declares video (no impact on pages without video).
  • 23 content files (EN + PT-BR): added the video frontmatter block (embedUrl + uploadDate).

Notes:

  • The Astro frameworks page has a second embed (FIMBJBpZsdU) not in the target list — only the requested lQo6rLigHfk was marked.
  • The two EN/PT-BR pairs (HOkuSudhKfE personal-tokens, soyIbJW0VdQ data-stream) were handled individually.

Verification:

  • astro sync regenerates content types with no schema errors.
  • Dev server: all 23/23 target URLs render a valid VideoObject with the expected embedUrl, plus thumbnailUrl, uploadDate, name and description; no contentUrl/duration.
  • A page without a video emits no VideoObject.

Additional links

Fixes the Google Search Console warning "Either contentUrl or
embedUrl should be specified" and enables video indexing / rich
results on the 23 documentation pages that embed a YouTube video.

Replicates the getVideoObjectSchema() logic already used in azion/site:
uses embedUrl (not contentUrl), derives thumbnailUrl from the YouTube
ID (https://i.ytimg.com/vi/{ID}/hqdefault.jpg), uses the page date as
uploadDate, and omits duration.

- add getVideoObjectSchema() builder in src/util/videoObject.ts
- add optional `video` object to baseSchema (config.ts) so the embed
  is sourced explicitly from frontmatter instead of parsing the body
- emit <script type="application/ld+json"> in HeadSEO.astro only when
  a page declares `video`
- add `video` frontmatter (embedUrl + uploadDate) to the 23 pages

Verified all 23 pages render a valid VideoObject with embedUrl,
thumbnailUrl, uploadDate and name; pages without video emit none.
@pauloSF0 pauloSF0 self-assigned this Jul 17, 2026
@pauloSF0
pauloSF0 requested a review from a team as a code owner July 17, 2026 16:42
@pauloSF0 pauloSF0 added the enhancement New feature or request label Jul 17, 2026
@egermano

Copy link
Copy Markdown
Contributor

@pauloSF0 aqui o mesmo comentário do repo do site precisamos desdobrar aqui. https://github.com/aziontech/site/pull/1544

arturdj
arturdj previously approved these changes Jul 22, 2026

@arturdj arturdj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested sample of 3 videos successfully.
Maybe an astro-link-validator could help in CI/CD for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants