schema.org SiteNavigationElement的正确用法是什么? [英] What is the correct use of schema.org SiteNavigationElement?

查看:136
本文介绍了schema.org SiteNavigationElement的正确用法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在搜索引擎优化条件... ... $ / b>

是否最好将该计划放在包含所有链接的父级?

 < nav itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement> 
< a href =#>连结1< / a>
< a href =#>连结2< / a>
< a href =#>连结3< / a>
< / nav>

...或者应该将每个链接视为自己的元素?

 < nav> 
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结1< / span>
< / a>
< / span>
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结2< / span>
< / a>
< / span>
< span itemscope =itemscopeitemtype =http://www.schema.org/SiteNavigationElement>
< a itemprop =urlhref =#>
< span itemprop =name>连结3< / span>
< / a>
< / span>
< / nav>


解决方案

如果 SiteNavigationElement

如果 SiteNavigationElement 是整个导航(即导航链接列表)的意思, code>用于单个导航条目(即导航链接列表中的链接),您的第二个示例是正确的。



我认为Schema.org没有明确定义哪个变体的意思,因为他们只说:


页面的导航元素。


但是,父类型 WebPageElement 定义为:


网页元素,如表格或图片


此外,所有其他子类型(如 WPFooter )似乎用于整个事情,而不是事物的特定部分。



所以这似乎表明整个导航应该被标记,而不是每个单链接:

 < nav itemscope itemtype =http://schema.org/SiteNavigationElement > 
< ul>
< li>< a href =/ link-1>链接1< / a>< / li> <! - 不要在这里使用'url'或'name'属性! - >
< li>< a href =/ link-2>链接2< / a>< / li>
< / ul>
< / nav>

在这种情况下,所有属性都属于整个导航,所以这意味着 url 属性将为此导航指定一个URL(而 not 此导航中链接的URL!)。


In SEO terms...

Is it best to put the scheme on the parent containing all the links?

<nav itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
</nav>

...or should each link be considered as it's own element?

<nav>
    <span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
        <a itemprop="url" href="#">
            <span itemprop="name">Link 1</span>
        </a>
    </span>
    <span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
        <a itemprop="url" href="#">
            <span itemprop="name">Link 2</span>
        </a>
    </span>
    <span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
        <a itemprop="url" href="#">
            <span itemprop="name">Link 3</span>
        </a>
    </span>
</nav>

解决方案

If SiteNavigationElement is meant for the whole navigation (i.e., a navigation link list), your first example is correct.

If SiteNavigationElement is meant for a single navigation entry (i.e., a link in the navigation link list), your second example is correct.

I think Schema.org doesn’t unambiguously define which variant is meant, as they only say:

A navigation element of the page.

However, the parent type WebPageElement is defined as:

A web page element, like a table or an image

Also, all the other child types (like Table or WPFooter) seem to be used for the whole thing, and not specific parts of the thing.

So this seems to suggest that the whole navigation should be marked up, and not each single link:

<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
  <li><a href="/link-1">Link 1</a></li> <!-- don’t use the 'url' or 'name' property here! -->
  <li><a href="/link-2">Link 2</a></li>
</ul>
</nav>

In this case, all the properties belong to the whole navigation, so that means the url property would specify a URL for this navigation (and not the URLs of the links in this navigation!).

这篇关于schema.org SiteNavigationElement的正确用法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆