Html link rel rss

RSS Advisory Board

Really Simple Syndication specifications, tutorials and discussion

RSS Autodiscovery

Editor’s Note: This is version 1.0 of this document, published Nov. 27, 2006.

1. Introduction

RSS autodiscovery is a technique that makes it possible for browsers and other software to automatically find a site’s RSS feed, whether it’s in RSS 1.0 or RSS 2.0 format.

Supported by Mozilla Firefox 2.0, Microsoft Internet Explorer 7.0 and other browsers, autodiscovery has become the best way to inform users that a web site offers a syndication feed. When a browser loads a page and discovers that a feed is available, Firefox and Internet Explorer display the common feed icon in the address bar.

Users can click the icon to subscribe with the browser’s RSS reader or the user’s preferred reader. Web publishers who offer feeds reach a wider potential audience with autodiscovery.

This specification describes how web publishers can support autodiscovery by adding an HTML header to web pages.

2. Conventions

In this documentation, the key words may , must , must not , optional , recommended , required , shall , shall not , should and should not are to be interpreted as described in RFC 2119.

Autodiscovery employs the link element from HTML and XHTML to identify a site’s syndication feed. The link must be placed within a web page’s head element to establish a relationship between the page and another document.

To support autodiscovery, a link element must be added to the header, as shown in this HTML markup from The RSS Blog:

The link can be placed within the header of the site’s home page, individual pages such as weblog entries and any other page where a user might want to know that a feed’s available. A head may include more than one autodiscovery link, but each must identify a different feed.

To make the RSS subscription process simple for inexperienced users, publishers should include only one autodiscovery link per page, using it to identify a site’s main feed.

If you decide to include more than one autodiscovery link, the first link should be the site’s main feed.

Publishers who offer the same feed content in several syndication formats should not use autodiscovery links for all of them. Choosing only one feed format for autodiscovery makes it easier on new subscribers, especially if they are unfamiliar with syndication and can’t distinguish between the Atom, RSS 1.0 and RSS 2.0 formats.

The link element must have three attributes that describe the relationship: href , rel and type and may have a title attribute.

Because attribute names must be lowercase in XHTML, autodiscovery link attributes should have lowercase names in HTML as well.

Читайте также:  Build your own python

3.1. href Attribute

The href attribute must be the feed’s URL. This can be a relative URL in pages that include a base element in the header.

Because some software might not check for a base URL in relation to autodiscovery links, publishers should identify feeds with full URLs. When an autodiscovery link is relative and no base URL has been provided, clients should treat the web page’s URL as the base.

3.2. rel Attribute

The rel attribute must have a value of «alternate», a keyword that indicates the link is an alternate version of the site’s main content.

Although for purposes other than autodiscovery this attribute may contain multiple keywords separated by spaces, in an autodiscovery link, the value must not contain keywords other than «alternate».

Additionally, though rel keywords are case-insensitive elsewhere, «alternate» must be lowercase.

3.4. title Attribute

The title attribute, when present, contains be a short, human-readable label such as the site’s name or the feed’s name. When a page contains more than one autodiscovery link, the title enables users to differentiate between the feeds, as demonstrated by Om Malik’s GigaOM site.

Each autodiscovery link has a different title, which Mozilla Firefox displays in a drop-down menu when a user clicks the common feed icon.

3.3. type Attribute

The type attribute must contain the feed’s MIME type, which is «application/rss+xml» for RSS 1.0 or RSS 2.0 feeds.

Although type values are case-insensitive for other HTML and XHTML links, the value must be lowercase for autodiscovery.

4. License

Copyright 2006 RSS Advisory Board. Redistribution and reuse of this document is permitted under the terms of the Creative Commons Attribution-ShareAlike 2.0 license.

5. Credits

Rogers Cadenhead, James Holderness and Randy Charles Morin contributed to this document. Comments and corrections regarding this document are encouraged on the RSS-Public mailing list.

Источник

Практический HTML: улучшаем семантику ссылок

Часть HTML-тегов и атрибуты мы используем каждый день в свой работе. Заголовки, параграфы, списки и картинки являются основой разметки каждого веб-разработчика. Но наиболее распространенным элементом, наверное, будет ссылка — простой тег, который связывает воедино все страницы, создавая ту самую беспорядочную структуру, которую мы называем Всемирная Сеть Интернет (WWW).

Ссылка как она есть

Весь потенциал ссылок заключается в атрибуте href , сокращение от hypertext reference . Он создает одностороннюю связь текущей страницы с другим ресурсом, обычно другой такой же страницей в интернете:

Атрибут href находится в открывающем теге a , между открывающим и закрывающим тегами находится текст для описания ссылки:

«Ну и что», — скажите вы. — «Это я все и так знаю», — и будете абсолютно правы! Но у ссылки есть еще кое-что, кроме атрибута href .

Теория относительности ( rel ativity)

Может быть, вы уже читали про атрибут rel у ссылки. Я готов поспорить, что в секции head ваших страниц будет располагаться что-нибудь типа этого:

Атрибут rel описывает связь между текущим документом и тем, на который он указывает. В этом случае, значением атрибута rel является stylesheet . Это означает, что связанный документ является таблицей стилей для текущего: между ними именно такая связь.

Еще одно распространенное употребление rel :

В данном случае связь между текущим документом и связанным — RSS-лентой — указана как alternate : альтернативное преставление текущего документа.

Оба этих примера используют тег link , но вы можете использовать атрибут rel и у обычных ссылок. Например, вы ссылаетесь на вашу RSS-ленту из секции :

Читайте также:  Php передача переменных массив

Вы можете добавить дополнительную информацию к этой ссылке, используя атрибут rel :

Не существует определенного списка значений для атрибута rel , поэтому вы можете использовать все, что посчитаете семантически разумным. Например, если у вас сложное коммерческое веб-приложение, в котором присутствует ссылка на подсказку, то вы можете определить связь между текущей страницей и этой подсказкой, используя значение help :

Элементарные микроформаты

Хотя вы абсолютно свободны в использовании значений атрибута rel , существует уже некоторые общепринятые значения при использовании микроформатов. Некоторые из простейших микроформатов предлагают варианты грамотного использования rel . Например, если вы ссылаетесь на лицензию, под которой опубликован данный документ, используйте микроформат rel-license :

Эта конструкция описывает, что текущая страница ссылается на документ, помеченный как «лицензия».

Микроформат rel-tag идет немного дальше. Он используется для указания на то, что последняя часть URL’а у ссылки является «меткой» для текущего документа:

В данном случае для этого документа добавлена метка «Microformats».

XFN (XHTML Friends Network) является способом описания отношений между людьми:

Этот микроформат в значительной степени расширяет возможное применение атрибута rel . Так же, как и атрибут class , rel может принимать несколько значений, разделенных пробелом:

Таким образом я указываю, что Drew мой друг, я с ним встречался, и он мой коллега (ведь мы оба фанатеем от интернета (Web monkies)).

«Мы — хотим перемен» ( rev olution)

Если rel описывает связь между текущей страницей и той, на которую она ссылается, (прим.: текущая страница -> другая страница) то rev используется для обратной зависимости: он определяет вид связи страницы, на которую ссылаются, с текущей (прим.: текущая страница ). Ниже приведен пример, который может быть использован в help.html:

Атрибут rev указывает, что текущая страница является страницей помощи, подсказкой для той, на которую она ссылается.

Микроформат vote-links позволяет вам использовать атрибут rev для уточнения ваших ссылок. Например, определяя значение vote-for , вы можете указать, что ваш документ поддерживает тот, на который ссылается:

Есть и соответствующее значение vote-against . Оно означает, что хоть вы и ссылаетесь на этот документ, но вы явно указываете, что с ним не согласны.

Естественно, ничего не мешает использовать в одной ссылке и rel , и rev :

Разумность большинства

За легкостью использования rel и rev скрывается богатый потенциал. Они позволяет относительно легко добавить в ваши ссылки больше семантического смысла, что создает связи, которые затем могут быть обработы поисковыми роботами, агрегаторами или браузерами. Пусть вашим следующим шагом станет тесное знакомство с этими атрибутами и расширение возможностей ссылок.

Сссылки по теме

Большое спасибо тем, кто прочитал всю статью полностью. Мне хотелось бы услышать ваше мнение или замечания по поводу использования rel/rev , в частности, или микроформатов вообще.

Источник

Linking An RSS Or Atom Feed to a HTML Document

Note: This post is over two years old and so the information contained here might be out of date. If you do spot something please leave a comment and we will endeavour to correct.

Adding a hyper link for an RSS or Atom feed on your web page works, but that’s not all you can do. By adding a link to the head section of the page you can allow your users an alternative method of picking up your feed.

To add an RSS feed use this.

To add an Atom feed use this.

These are both XHTML examples. To do this in HTML just remove the slash on the right hand side like this.

You can add more than one link attribute to a page with no ill effects. If you provide multiple feeds most modern browsers will give you a list of feeds to select from.

Phil Norton

Phil is the founder and administrator of #! code and is an IT professional working in the North West of the UK. Graduating in 2003 from Aberystwyth University with an MSc in Computer Science Phil has previously worked as a database administrator, on an IT help desk, systems trainer, web architect, usability consultant, blogger and SEO specialist. Phil has lots of experience building and maintaining PHP websites as well as working with associated technologies like JavaScript, HTML, CSS, XML, Flex, Apache, MySQL and Linux.

Want to know more? Need some help?

Let us help! Hire us to provide training, advice, troubleshooting and more.

Support Us!

Please support us and allow us to continue writing articles.

Comments

DebugBear, is saying that itemprop=»» should be used.

Submitted by GH on Sat, 04/02/2022 — 20:29

Add new comment

The iframe srcdoc Attribute

I was working on a web page generation program recently and was looking for a way to present different versions of the same page with slight differences in the markup and styles. Although using the iframe element came to mind I wasn’t keen on rendering out lots of different versions of the page and then referencing them individually in each iframe.

Creating A Personalised Events List With SimplePie

One nice feature for any blog or site (especially news sites) is to have a little list of forthcoming events that would interest your readers. One way of collating this information is to scour the web and update the list manually. However, this is time consuming and tedious, especially as there is an easier way to do it.

Using The view-source Protocol

If you are running FireFox (or Chrome) then there is a handy little short cut you can use to view the source of a page you are looking at. If you add the text view-source on any web address then you will see the equivalent of viewing the source of a page (perhaps by pressing Ctrl+u).

HTML And XHTML Doctypes

In order to validate any page of HTML or XHTML you will need a doctype. This is a string of text that sits at the top of the document and tells the browser exactly what markup standard has been used to create the page.

HTML Meta Refresh

To get a webpage to refresh every few seconds you can use a meta tag with the attribute http-equiv and a value of refresh. The number of seconds to delay can be put into the content attribute. This meta tag (as will all meta tags) goes into the head section of the document.

Here is an example that refreshes the page every 2 seconds.

External JavaScript Include In HTML

To include a JavaScript file into a HTML page you can use the script tag with the src parameter pointing towards the source code file. However, there is a subtle difference between the script tag in HTML and XHTML. This is because the language attribute is not supported in XHTML, so if you just copy the code from HTML to XHTML the page won’t validate.

Источник

Оцените статью