[MM-15278] feat(seo): emit VideoObject JSON-LD on doc pages with video#2274
Open
pauloSF0 wants to merge 2 commits into
Open
[MM-15278] feat(seo): emit VideoObject JSON-LD on doc pages with video#2274pauloSF0 wants to merge 2 commits into
pauloSF0 wants to merge 2 commits into
Conversation
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
requested review from
egermano,
isaquebock and
madureira-gabriel
as code owners
July 17, 2026 16:42
Contributor
|
@pauloSF0 aqui o mesmo comentário do repo do site precisamos desdobrar aqui. https://github.com/aziontech/site/pull/1544 |
arturdj
previously approved these changes
Jul 22, 2026
arturdj
left a comment
Contributor
There was a problem hiding this comment.
Tested sample of 3 videos successfully.
Maybe an astro-link-validator could help in CI/CD for this.
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.
Related issue
Google Search Console warning: "Either 'contentUrl' or 'embedUrl' should be specified" — videos not being indexed.
Changes
This PR emits a schema.org
VideoObjectJSON-LD on the 23 documentation pages that embed a YouTube video, so Google can index them and enable rich results. It fixes the GSCcontentUrl/embedUrlwarning.The logic replicates the
getVideoObjectSchema()approach already shipped inazion/site(learning/blog pages), adapted to this repo's Astro architecture:embedUrl(nevercontentUrl);thumbnailUrlfrom the YouTube ID (https://i.ytimg.com/vi/{ID}/hqdefault.jpg);uploadDate;duration.Core changes:
src/util/videoObject.ts(new):getVideoObjectSchema()builder.src/content/config.ts: added an optionalvideoobject (embedUrl+ optionaltitle/description/uploadDate/thumbnailUrl) tobaseSchema. The embed is sourced explicitly from frontmatter instead of parsing the page body.src/components/HeadSEO.astro: emits<script type="application/ld+json">with theVideoObjectonly when the page declaresvideo(no impact on pages without video).videofrontmatter block (embedUrl+uploadDate).Notes:
FIMBJBpZsdU) not in the target list — only the requestedlQo6rLigHfkwas marked.HOkuSudhKfEpersonal-tokens,soyIbJW0VdQdata-stream) were handled individually.Verification:
astro syncregenerates content types with no schema errors.VideoObjectwith the expectedembedUrl, plusthumbnailUrl,uploadDate,nameanddescription; nocontentUrl/duration.VideoObject.Additional links