gpt4 book ai didi

html - 图像的正确 OpenGraph 标记是什么?

转载 作者:行者123 更新时间:2023-11-28 01:46:06 27 4
gpt4 key购买 nike

OpenGraph documentation提供了一个“全图示例”:

<meta property="og:image" content="http://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />

但是,这与提到以下属性的开场齐发冲突是必需的:

og:title
og:type
og:image
og:url

那么,是否也需要这样的东西?

<meta property="og:type" content="???" />

或者当 og:image 属性存在时,是否以某种方式隐式不再需要 og:type?还是 og:image:type 以某种方式神奇地取代了对“og:type”的明确要求?

最佳答案

我认为您正确地指出了协议(protocol)中的错误。根据文档,这听起来像是对 og:type 的共识图像尚未达到。

查看what Instagram does for their images看起来您需要实现自定义命名空间类型。

<meta property="og:type" content="instapp:photo" />

有一些信息直接说明了这一点 in the spec :

When the community agrees on the schema for a type, it is added to the list of global types. All other objects in the type system are CURIEs of the form

<head prefix="my_namespace: http://example.com/ns#">
<meta property="og:type" content="my_namespace:my_type" />

The global types are grouped into verticals. Each vertical has its own namespace. The og:type values for a namespace are always prefixed with the namespace and then a period. This is to reduce confusion with user-defined namespaced types which always have colons in them.

关于html - 图像的正确 OpenGraph 标记是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22567383/

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