简体   繁体   English

正确部署Google Rich Card的结构化数据

[英]Correct deployment of structured data for Google rich cards

I am confused as to the correct inclusion of structured data, primarily for google rich media. 对于正确包含结构化数据(主要是针对Google富媒体),我感到困惑。


1. Must/should every page have it's own json, or should the root page contain the json for all pages? 1.每个页面必须/应该具有自己的json,还是根页面应包含所有页面的json?


2. The structured data is essentially JavaScript. 2.结构化数据本质上是JavaScript。 Does it have to be inline, or can it be in another file? 它必须是内联的,还是可以在另一个文件中?


3. A normal browser might waste time with big structured data JavaScript - information which is irrelevant to it. 3.普通的浏览器可能会浪费大量的结构化数据JavaScript时间-与之无关的信息。 Is there a good solution/best practice for dealing with this? 是否有解决此问题的最佳解决方案/最佳实践?

  1. Yes, it should. 是的,应该。 Structured data is based on the URI paradigm. 结构化数据基于URI范式。 It means, the unique ID of the document is its URL. 这意味着文档的唯一ID是其URL。 So yes, your structured data belongs always to certain URL. 因此,是的,您的结构化数据始终属于某个URL。
  2. No, it isn't. 不,不是。 JSON-LD is not a javascript, even thought it is implemented with the <script> - but it isn't a javascript. JSON-LD不是JavaScript,甚至认为它是用<script> -但它不是JavaScript。 And no, it can't be in another file. 不,它不能在另一个文件中。
  3. Not, it doesn't. 不,不是。 Browser don't interpret JSON-LD scripts - they don't need it, this information is not for them and it isn't relevant for the browser's job, which is page rendering. 浏览器不解释JSON-LD脚本-他们不需要它,该信息不适用于它们,并且与浏览器的工作(页面渲染)无关。 JSON-LD scripts can indeed be placed on the bottom of the HTML source code - but you will not realize any acceleration impact by this. 确实可以将JSON-LD脚本放在HTML源代码的底部-但您不会因此而意识到任何加速影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM