元数据标识网页
第2行: | 第2行: | ||
<p style="text-indent:24px;">为了使一个网页的内容变成微博可识别的,需要将元数据信息添加到这个网页里。根据基本的RDFa协议,需要在网页源代码的<head>标签里,附加新的<meta>标签。每个页面通用的5个基本属性是:type、title、image、url、text,其中,type、title、url是必须有的。</p> | <p style="text-indent:24px;">为了使一个网页的内容变成微博可识别的,需要将元数据信息添加到这个网页里。根据基本的RDFa协议,需要在网页源代码的<head>标签里,附加新的<meta>标签。每个页面通用的5个基本属性是:type、title、image、url、text,其中,type、title、url是必须有的。</p> | ||
+ | |||
+ | ==如何在网页上标识元数据,例如:== | ||
+ | |||
+ | 为 [http://book.douban.com/subject/4909176/ 社交网站界面设计(豆瓣)] 网页添加元数据: | ||
+ | |||
+ | |||
+ | <b>1、在<html>标签里增加命名空间“wb”</b> | ||
+ | |||
+ | <pre> | ||
+ | <html xmlns:wb="http://weibo.com/ns#"> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <b>2、在<head>标签里编辑<meta>标签</b> | ||
+ | |||
+ | <pre> | ||
+ | <html xmlns:wb="http://weibo.com/ns#"> | ||
+ | <head> | ||
+ | <title>社交网站界面设计(豆瓣)</title> | ||
+ | <meta property="wb:type" content="book" /> | ||
+ | <meta property="wb:title" content="社交网站界面设计" /> | ||
+ | <meta property="wb:url" content="http://book.douban.com/subject/4909176/" /> | ||
+ | <meta property="wb:image" content="http://img3.douban.com/mpic/s4411117.jpg" /> | ||
+ | ... | ||
+ | </head> | ||
+ | ... | ||
+ | </html> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <b>3、除了通用属性,还可以添加类型属性,这些属性是可选的,一般建议添加</b> | ||
+ | |||
+ | <pre> | ||
+ | <meta property="wb:isbn" content="9787111305187" /> | ||
+ | <meta property="wb:author" content="Christian Crumlish / Erin Malone" /> | ||
+ | <meta property="wb:year" content="2010" /> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <b>4、类型属性可以组合使用,比如在这个页面还提供购买服务,则可以组合添加支付属性,这也是可选的</b> | ||
+ | |||
+ | <pre> | ||
+ | <meta property="wb:seller" content="九久网上书城" /> | ||
+ | <meta property="wb:price" content="69.00" /> | ||
+ | <meta property="wb:discount" content="62.10" /> | ||
+ | </pre> | ||
+ | |||
+ | ==微博元数据== | ||
+ | |||
+ | 参考:[http://open.t.sina.com.cn/wiki/index.php/Metadata Metadata微博元数据] |
2010年11月22日 (一) 10:09的最后版本
概述
为了使一个网页的内容变成微博可识别的,需要将元数据信息添加到这个网页里。根据基本的RDFa协议,需要在网页源代码的<head>标签里,附加新的<meta>标签。每个页面通用的5个基本属性是:type、title、image、url、text,其中,type、title、url是必须有的。
如何在网页上标识元数据,例如:
为 社交网站界面设计(豆瓣) 网页添加元数据:
1、在标签里增加命名空间“wb”
2、在标签里编辑标签
社交网站界面设计(豆瓣) ... ... </pre>
<b>3、除了通用属性,还可以添加类型属性,这些属性是可选的,一般建议添加<meta property="wb:isbn" content="9787111305187" /> <meta property="wb:author" content="Christian Crumlish / Erin Malone" /> <meta property="wb:year" content="2010" />
4、类型属性可以组合使用,比如在这个页面还提供购买服务,则可以组合添加支付属性,这也是可选的<meta property="wb:seller" content="九久网上书城" /> <meta property="wb:price" content="69.00" /> <meta property="wb:discount" content="62.10" />微博元数据
文档更新时间: 2010-11-22