Html 如何把文章放在网页元素里面?
所以我有一个Html 如何把文章放在网页元素里面?,html,schema.org,microdata,google-rich-snippets,Html,Schema.org,Microdata,Google Rich Snippets,所以我有一个网页,在这个网页里面我有一篇文章。 现在我知道这不是问题,但当我使用此工具时: 我注意到网页没有名称和说明等元素,在这种情况下我该怎么办?我们应该忽略它吗?因为即使我为name和description设置了meta标记,它也将与文章的100%相同,然后它可能会使内容加倍或值加倍,我该怎么办 我的页面示例: <html> <head> <title></title> </head> <body itemscope it
网页
,在这个网页
里面我有一篇文章
。
现在我知道这不是问题,但当我使用此工具时:
我注意到网页
没有名称
和说明
等元素,在这种情况下我该怎么办?我们应该忽略它吗?因为即使我为name和description设置了meta标记,它也将与文章
的100%相同,然后它可能会使内容加倍或值加倍,我该怎么办
我的页面示例:
<html>
<head>
<title></title>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<nav class="navbar navbar-default" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> HERE COME THE NAVIGATION CODE
</nav>
<main itemscope itemtype="http://schema.org/Article">
<h1 itemprop="name">Name</h1>
<p itemprop="description">Description</p>
</main>
<div id="some-links">
<ul>
<li><a itemprop="relatedLink" href="" class="active"><span class="icon icon-eye"></span> Cat Overview</a></li>
<li><a itemprop="relatedLink" href=""><span class="icon icon-dog"></span> Cat Breeds</a></li>
<li><a itemprop="relatedLink" href=""><span class="icon icon-article"></span> Cat Articles</a></li>
<li><a itemprop="relatedLink" href=""><span class="icon icon-paw"></span> Cat Adoption</a></li>
</ul>
</div>
</main>
</body>
</html>
导航码来了
名称
说明
您的网页不为空。它有5个relatedLink
属性。但即使它是空的,也不是问题
网页
的名称
可以是标题
元素的值(例如,通常包括页面和站点名称),而文章
的名称
可以是页面标题的值(例如,通常没有站点名称)
您可以将SiteNavigationElement
链接到网页
项(目前两者都是顶级项,彼此不相关),例如:
我想同样的属性也可以用来链接网页
和文章
。不幸的是,Schema.org缺少一个属性来表示网页的主要内容/项(不能使用)。如下:
<html>
<body itemscope itemtype="http://schema.org/WebPage">
<article itemprop="mainEntity" itemscope itemtype="http://schema.org/Article">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
<h2 itemprop="headline">Article headline</h2>
<h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
By <span itemprop="name">John Doe</span>
</h3>
<span itemprop="description">A most wonderful article</span>
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="https://google.com/thumbnail1.jpg"/>
<meta itemprop="url" content="https://google.com/thumbnail1.jpg">
<meta itemprop="width" content="800">
<meta itemprop="height" content="800">
</div>
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<img src="https://google.com/logo.jpg"/>
<meta itemprop="url" content="https://google.com/logo.jpg">
<meta itemprop="width" content="600">
<meta itemprop="height" content="60">
</div>
<meta itemprop="name" content="Google">
</div>
<meta itemprop="datePublished" content="2015-02-05T08:00:00+08:00"/>
<meta itemprop="dateModified" content="2015-02-05T09:20:00+08:00"/>
</article>
</body>
</html>
,我的问题是搜索引擎将如何阅读它?作为文章,获取有关字数等信息,还是作为网页?或者两者兼而有之?@MyLibary:讨论搜索引擎服务(或SEO)的行为与堆栈溢出无关(因为这样的事情很难被证明,通常是基于观点的,经常变化等等)。消费者(如搜索引擎)解析您的文档时,会了解到存在有关网页
和文章
的信息。如果您使用类似于hasPart
的属性,消费者还会了解到文章
是网页
的一部分。消费者对这些信息的理解完全取决于他们。好的,对不起,谢谢你的批评。所以我最好将文章部分也设为“itemprop=”hasPart?,非常感谢您的帮助。
<html>
<body itemscope itemtype="http://schema.org/WebPage">
<article itemprop="mainEntity" itemscope itemtype="http://schema.org/Article">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
<h2 itemprop="headline">Article headline</h2>
<h3 itemprop="author" itemscope itemtype="https://schema.org/Person">
By <span itemprop="name">John Doe</span>
</h3>
<span itemprop="description">A most wonderful article</span>
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<img src="https://google.com/thumbnail1.jpg"/>
<meta itemprop="url" content="https://google.com/thumbnail1.jpg">
<meta itemprop="width" content="800">
<meta itemprop="height" content="800">
</div>
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<img src="https://google.com/logo.jpg"/>
<meta itemprop="url" content="https://google.com/logo.jpg">
<meta itemprop="width" content="600">
<meta itemprop="height" content="60">
</div>
<meta itemprop="name" content="Google">
</div>
<meta itemprop="datePublished" content="2015-02-05T08:00:00+08:00"/>
<meta itemprop="dateModified" content="2015-02-05T09:20:00+08:00"/>
</article>
</body>
</html>