WebSite 中的 url 属性 应该代表主页还是当前正在呈现的页面?
Should the url property in WebSite represent the main page or the current page being rendered?
我正在尝试将微数据添加到我的网站以帮助搜索引擎了解我的内容。 WebSite
definition requires a property called url
。我很困惑我应该把 URL 放在这里。 url
应该是主页的 URL 还是正在呈现的当前页面?
例如,如果我想为 https://example.com/i/12/some-tag
创建微数据。 url
会是 https://example.com
还是规范的 URL(即 https://example.com/i/12/some-tag
)?
WebSite
的url
应该是网站的首页。
如果要提供有关当前页面的结构化数据,可以使用 WebPage
及其 url
属性.
<!-- on https://example.com/i/12/some-tag -->
<body itemscope itemtype="http://schema.org/WebPage">
<link itemprop="url" href="https://example.com/i/12/some-tag" />
<div itemprop="isPartOf" itemscope itemtype="https://schema.org/WebSite">
<link itemprop="url" href="https://example.com/" />
</div>
</body>
对于主页本身,WebSite
和 WebPage
将具有相同的 url
值。通过为每个项目提供自己的 URI 作为标识符(通过 Microdata 的 itemid
属性),您可以区分这两个(以及所有其他)项目。
我正在尝试将微数据添加到我的网站以帮助搜索引擎了解我的内容。 WebSite
definition requires a property called url
。我很困惑我应该把 URL 放在这里。 url
应该是主页的 URL 还是正在呈现的当前页面?
例如,如果我想为 https://example.com/i/12/some-tag
创建微数据。 url
会是 https://example.com
还是规范的 URL(即 https://example.com/i/12/some-tag
)?
WebSite
的url
应该是网站的首页。
如果要提供有关当前页面的结构化数据,可以使用 WebPage
及其 url
属性.
<!-- on https://example.com/i/12/some-tag -->
<body itemscope itemtype="http://schema.org/WebPage">
<link itemprop="url" href="https://example.com/i/12/some-tag" />
<div itemprop="isPartOf" itemscope itemtype="https://schema.org/WebSite">
<link itemprop="url" href="https://example.com/" />
</div>
</body>
对于主页本身,WebSite
和 WebPage
将具有相同的 url
值。通过为每个项目提供自己的 URI 作为标识符(通过 Microdata 的 itemid
属性),您可以区分这两个(以及所有其他)项目。