WordPress 模板中经常会看到link rel=”profile” href=”http://gmpg.org/xfn/11″标签,这个 profile 声明到底有什么用呢?

WordPress 模板中经常会看到如下 link 标签,这个 profile 声明到底有什么用呢?

<link rel="profile" href="http://gmpg.org/xfn/11">

不同浏览器可以根据自己设定的默认样式来呈现网页,比如你把朋友定义成“friend”,而我要按照拼音来定义成“pengyou”,彼此之间无法统一,该 功能就变得没有丝毫的意义。所以我们在HTML文档的标签中使用 profile 属性引入一个声明,声明在这个HTML文档中使用了 XML Friends Network (XFN) 微格式,然后按照这份XFN微格式中约定的方式来描述关系网络,于是即使是不同用户代理器访问这些数据只要其遵循XFN的约定即可正确的读取出其中的关系 数据。The following link tags are often seen in WordPress templates. What is the use of this profile statement?
<link rel=”profile” href=”http://gmpg.org/xfn/11″>Different browsers can render web pages according to the default style set by themselves. For example, if you define a friend as “friend”, and I To define “pengyou” according to pinyin, if they cannot be unified with each other, the function becomes meaningless. So we use the profile attribute to introduce a declaration in the tags of the HTML document, stating that the XML Friends Network (XFN) microformat is used in this HTML document, and then describe the relational network in the way agreed in this XFN microformat, so even Different user agents access these data as long as they follow the XFN conventions to correctly read the relational data.
Of course, the micro-format data is of no practical significance to users who usually read HTML documents through a browser, but for some user agents, by reading this XFN micro-format data and adding If you upload other micro-format data such as hCard, then you can present a network of relationships between people on the Internet.
For different data declarations, you need to specify the location of the description, and the value of the profile is the location of the description of this data, or it can be simply understood as specifying the same convention rules for different user agents.
For multiple data declarations quoted in a page, you only need to separate them with spaces in the profile value.

当然,这其中的微格式数据对于平常通过浏览器来阅读HTML文档的用户来说,没有什么实际性的意义,可是对于某些用户代理器来说,通过读取这份XFN微格 式数据再加上其它的诸如hCard等微格式数据,那么即可在互联网上呈现出人与人之间的关系网络。

对于不同的数据声明需要为其指定描述的位置,而profile的值即是对这个数据的描述的位置,或者可以简单的理解成是为不同的用户代理器指定相同的约定 规则。