gpt4 book ai didi

html - 如何使用微数据标记 "Related News"?

转载 作者:太空狗 更新时间:2023-10-29 14:16:13 26 4
gpt4 key购买 nike

一篇新闻文章就像

<article itemscope itemtype="http://schema.org/NewsArticle">       

<h1 itemprop="headline">Awesome News</h1>

<div itemprop="articleBody">
bla bla bla...
</div>

</article>

如果我想包含相关新闻并对其进行标记怎么办?

<ul>
<li><a href="related_news_1.html">Related News 1</a></li>
<li><a href="related_news_2.html">Related News 2</a></li>
<li><a href="related_news_3.html">Related News 3</a></li>
</ul>

最佳答案

尝试使用来自 WebPage itemtype 的元素(来自:http://schema.org/WebPage,我知道您在这种情况下使用的是 NewsArticle,但我在这个示例中使用了 Article):

<div itemscope itemtype="http://schema.org/Article">
<span itemprop="name">How to Tie a Reef Knot</span>
by <span itemprop="author">John Doe</span>
This article has been tweeted 1203 times and contains 78 user comments.
<meta itemprop="interactionCount" content="UserTweets:1203" />
<meta itemprop="interactionCount" content="UserComments:78" />
</div>


<ul itemscope itemtype="http://schema.org/WebPage">
<li itemprop="relatedLink"><a href="related_news_1.html">Related News 1</a></li>
<li itemprop="relatedLink"><a href="related_news_2.html">Related News 2</a></li>
<li itemprop="relatedLink"><a href="related_news_3.html">Related News 3</a></li>
</ul>

Google 网站站长工具是这样看的:

enter image description here

或者你可以这样做:

<ul itemscope itemtype="http://schema.org/WebPage">
<li><a href="related_news_1.html" itemprop="relatedLink">Related News 1</a></li>
<li><a href="related_news_2.html" itemprop="relatedLink">Related News 2</a></li>
<li><a href="related_news_3.html" itemprop="relatedLink">Related News 3</a></li>
</ul>

Google 是这样看的:

enter image description here

关于html - 如何使用微数据标记 "Related News"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17588732/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com