AMP-HTML 页面未通过结构化数据测试工具中的验证
AMP-HTML page not pass validation in Structured Data Testing Tool
我的页面未通过结构化数据测试工具中的 AMP-HTML 验证
如果我在结构化数据测试工具中复制相同的 html 代码,它会通过验证。为什么?
这个有效:
https://gist.github.com/jaygray0919/8b5d86fc63ff6ea3656f0a0253fc31e7
确保您的图片尺寸准确无误。请注意,我使用了 Mertens1.jpg 的准确值。您可以在 CSS 中重新缩放它们 - 或者让 Google 动态地进行 - 但在 JSON-LD
岛中提供准确的数据。
还要确保大小属性按宽度排序,然后按高度排序。
AMP 页面对其结构化数据有更严格的要求。1
您的代码段验证失败的原因是 NewsArticle
图片必须至少 696 像素宽:2
image (required) : The representative image of the article.
Only a marked-up image that directly belongs to the article should be specified.
- Images should be at least 696 pixels wide.
- Images should be in .jpg, .png, or .gif format.
- Image URLs should be crawlable and indexable.
因此,简单地将报告的宽度增加到 696 像素或以上可能会导致您的标记生效,但为了安全起见,您应该报告实际尺寸。
1 “Top Stories with AMP”
我的页面未通过结构化数据测试工具中的 AMP-HTML 验证
如果我在结构化数据测试工具中复制相同的 html 代码,它会通过验证。为什么?
这个有效:
https://gist.github.com/jaygray0919/8b5d86fc63ff6ea3656f0a0253fc31e7
确保您的图片尺寸准确无误。请注意,我使用了 Mertens1.jpg 的准确值。您可以在 CSS 中重新缩放它们 - 或者让 Google 动态地进行 - 但在 JSON-LD
岛中提供准确的数据。
还要确保大小属性按宽度排序,然后按高度排序。
AMP 页面对其结构化数据有更严格的要求。1
您的代码段验证失败的原因是 NewsArticle
图片必须至少 696 像素宽:2
image (required) : The representative image of the article.
Only a marked-up image that directly belongs to the article should be specified.
- Images should be at least 696 pixels wide.
- Images should be in .jpg, .png, or .gif format.
- Image URLs should be crawlable and indexable.
因此,简单地将报告的宽度增加到 696 像素或以上可能会导致您的标记生效,但为了安全起见,您应该报告实际尺寸。
1 “Top Stories with AMP”