Open Graph通讯协定(Protocol)本身是一种制定一套Metatags的规格,用来标注你的页面,告诉我们你的网页代表哪一类型的现实世界物件。
2010年F8会议上Facebook公布了Open Graph,把这种种不同的Graph连结起来,将形成Open Graph
即这种协议可以让网页成为一个“富媒体对象”。
用了Meta Property=og标签,就是你同意了网页内容可以被其他社会化网站引用等,目前这种协议被SNS网站如Fackbook、renren采用。
SNS已经成为网络上的一大热门应用,优质的内容通过分享在好友间迅速传播。为了提高站外内容的传播效率,2010年F8会议上Facebook公布 了一套开放内容协议(Open Graph Protocol),任何网页只要遵守该协议,SNS就能从页面上提取最有效的信息并呈现给用户。
通过Meta Property=og标签实现。
og是一种新的HTTP头部标记,即Open Graph Protocol:
范例1:
(来源:startbootstrap.com首页)
<meta property="og:title" content="Free Bootstrap Themes, Templates, Snippets, and Guides">
<meta property="og:site_name" content="Start Bootstrap">
<meta property="og:type" content="website">
<meta property="og:description" content="Start Bootstrap develops free to download, open source Bootstrap 4 themes, templates, and snippets and creates guides and tutorials to help you learn more about designing and developing with Bootstrap.">
<meta property="og:image" content="https://startbootstrap.com/assets/img/branding/og-start-bootstrap.png">
<meta property="og:url" content="https://startbootstrap.com/">
<meta property="og:image:alt" content="Free Bootstrap Themes, Templates, Snippets, and Guides">
范例2:
(来源:genesis主题网站的首页)
<!-- Genesis Open Graph -->
<meta property="og:title" content="xxx | 又一个WordPress站点" />
<meta property="og:type" content="website" />
<meta property="og:description" content="xxxx" />
<meta property="og:url" content="http://127.0.0.1/genesis/" />
<meta property="og:image" content="http://127.0.0.1/genesis/wp-content/uploads/2020/09/advantage04.png" />
<meta property="og:image:width" content="305" />
<meta property="og:image:height" content="305" />