开放图元标记(Facebook)

No wonder, Facebook is social network number one that is used widely (especially in advertising) by nearly all companies worldwide. It is much more convenient to use the most known network where almost everyone living on our planet is registered in. This brings huge traffic, and many companies are working with their customers using their Facebook pages. Moreover, they use specal facebook widgets like: ‘Like’, ‘Share’, ‘Comments’ and ‘Recommend’ on their websites. The Open Graph Meta tags (or Facebook Open Graph API) that I am going to describe today will help you control over information to be shared on facebook (like url, title, image and description).

难怪,Facebook是社交网络第一,几乎全世界所有公司都广泛使用它(尤其是在广告中)。 使用最知名的网络进行注册要方便得多,几乎所有生活在地球上的人都在该网络中注册。这带来了巨大的流量,许多公司正在使用其Facebook页面与客户合作。 此外,他们在网站上使用特殊的Facebook小部件,例如:“喜欢”,“共享”,“评论”和“推荐”。 我今天要描述的Open Graph Meta标签(或Facebook Open Graph API)将帮助您控制要在Facebook上共享的信息(例如url,标题,图像和描述)。

总览 (Overview)

As the name implies, Facebook turns websites in some kind of graph objects. When we call any method (share, like and so on), Facebook requests the necessary information from the page where the function was called. Open Graph let us customize this information via custom meta tags on page. All these meta tags have og: prefix. Now, let’s have a look to all these meta tags.

顾名思义,Facebook将网站转换为某种图形对象。 当我们调用任何方法(共享等)时,Facebook会从调用该函数的页面上请求必要的信息。 Open Graph让我们通过页面上的自定义meta标签自定义此信息。 所有这些元标记都有og:前缀。 现在,让我们看一下所有这些元标记。

标题 (Title)


<meta property="og:title" content="Title example" />

<meta property="og:title" content="Title example" />

The title tag is used to specify the page title.

title标签用于指定页面标题。

网址 (Url)


<meta property="og:url" content="http://website_url/" />

<meta property="og:url" content="http://website_url/" />

The url tag is used to indicate the webpage address (that should be canonical).

url标记用于指示网页地址(应该是规范的)。

图片 (Image)


<meta property="og:image" content="http://website_url/image.png" />

<meta property="og:image" content="http://website_url/image.png" />

To allow Facebook to use a specific image, we can use the Image meta tag. We recommend to use images in popular formats: jpg / png. Try to avoid using very small images (for better quality).

为了允许Facebook使用特定的图像,我们可以使用Image meta标签。 我们建议使用以下流行格式的图像:jpg / png。 尽量避免使用很小的图像(以获得更好的质量)。

site_name (site_name)


<meta property="og:site_name" content="My website name" />

<meta property="og:site_name" content="My website name" />

If you specify this meta tag, your website name will be recognized with this name.

如果指定此元标记,则将使用此名称识别您的网站名称。

类型 (Type)


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

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

This meta tag helps Facebook to categorize your website. Possible values are: article, place, product, profile and so on. Complete list of the types is here.

此元标记可帮助Facebook对您的网站进行分类。 可能的值为:商品,地点,产品,配置文件等。 类型的完整列表在这里

描述 (Description)


<meta property="og:description" content="A brief description of the content" />

<meta property="og:description" content="A brief description of the content" />

The description is usually between 2 and 4 sentences. It will be displayed below the title of the post on Facebook.

描述通常在2到4个句子之间。 它将显示在Facebook上帖子标题的下方。

视频 (Video)


<meta property="og:video" content="https://website_url/video/" />

<meta property="og:video" content="https://website_url/video/" />

This let you specify URL for the video. If you want the video to play in-line in News Feed, you should use the https:// URL if possible.

这使您可以指定视频的URL。 如果您希望视频在新闻源中内嵌播放,则应尽可能使用https:// URL。

结论 (Conclusion)

Today we described most popular Facebook Open Graph Meta tags. To get more details about other tags, visit the Open Graph page. The use of tags is invaluable to your site, use attractive titles and images, and you will notice an influx of new visitors from Facebook.

今天,我们描述了最受欢迎的Facebook Open Graph Meta标签。 要获取有关其他标签的更多详细信息,请访问“ 打开图”页面。 标签的使用对您的网站来说是无价的,使用吸引人的标题和图像,并且您会注意到来自Facebook的新访客的涌入。

翻译自: https://www.script-tutorials.com/open-graph-meta-tags-facebook/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值