在一个网站中,og:title的价值是什么,而不是简单的title元素?

问题描述 投票:1回答:1

为什么Open Graph specification需要,而不仅仅是支持,建议或推荐使用og:title,而在许多情况下,它将与来自HTML,RDFa超集的<title></title>完全冗余?

如果为了简洁,正常化和普遍不喜欢官僚主义的复制,会选择省略og:title会发生什么?

opengraph open-graph-protocol rdfa html-title
1个回答
2
投票

title元素和og:title属性通常不具有相同的内容。

两者通常都给出主要实体的标题,但另外给出title元素should provide context(例如,站点名称)。

(但即使它们具有相同的内容,最好允许消费者通过仅解析RDFa来获取所有OGP数据,而不是HTML。)

Let’s take this question page as example

<title>opengraph - In a website, what is the value of og:title as opposed to a plain title element? - Stack Overflow</title>
<meta name="twitter:title" property="og:title" itemprop="title name" content="In a website, what is the value of og:title as opposed to a plain title element?" />

title是:

opengraph - 在一个网站中,og:title的价值与普通的title元素相比是什么? - 堆栈溢出

og:title是:

在一个网站中,og:title的价值是什么,而不是简单的title元素?

What if they are the same?

然后你可以在og:title元素上提供title属性:

<title property="og:title">…</title>

(但请注意,遗憾的是,一些OGP消费者可能不支持除meta元素以外的任何其他内容。)

© www.soinside.com 2019 - 2024. All rights reserved.