shortlink-brainstorming: Difference between revisions
(move expanded description from rel-shortlink to here.) |
m (Replace <entry-title> with {{DISPLAYTITLE:}}) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:shortlink brainstorming}} | |||
Part of the [[shortlink]] effort. Per the microformats [[process]] this page is here to document brainstorming for references to shortened URLs/links. | Part of the [[shortlink]] effort. Per the microformats [[process]] this page is here to document brainstorming for references to shortened URLs/links. | ||
Line 8: | Line 8: | ||
== proposals == | == proposals == | ||
* ... | * [[rel-shortlink]] | ||
=== hAtom and shortlink === | |||
Here is an algorithm for doing shortlink discovery in an [[hAtom]] entry: | |||
# In an hAtom post ("hentry"), grab the first link with rel values of "bookmark" and "shortlink" (per [[rel-shortlink]] ) and use it as the shortened link for that hAtom entry. | |||
# Lacking any such link, use the first element inside the "hentry" with class names of "url" and "shortlink" inside the hAtom entry. | |||
Advantages over methods involving a separate resource/file; | |||
* No separate file required, no separate discovery path required. | |||
* Much better to keep a tight visible connection between a post and the shortlink for the post. (see Ruby's postulate about metadata / data distance). | |||
A similar algorithm can be applied to an [[Atom]] feed with Atom entry elements, using a link element with rel values of alternate and shortlink, and lacking that, nested well-formed (X)HTML in the Atom entry with an element with class name of "shortlink". | |||
== see also == | == see also == |
Latest revision as of 16:33, 18 July 2020
Part of the shortlink effort. Per the microformats process this page is here to document brainstorming for references to shortened URLs/links.
Additionally documentation of why/how rel="shortlink" was developed/proposed, along with reasoning of why other shortlink formats may be inadequate (extract that from the "inferior alternatives" section at the end of the rel-shortlink page.)
This article is a stub. You can help the microformats.org wiki by expanding it.
proposals
hAtom and shortlink
Here is an algorithm for doing shortlink discovery in an hAtom entry:
- In an hAtom post ("hentry"), grab the first link with rel values of "bookmark" and "shortlink" (per rel-shortlink ) and use it as the shortened link for that hAtom entry.
- Lacking any such link, use the first element inside the "hentry" with class names of "url" and "shortlink" inside the hAtom entry.
Advantages over methods involving a separate resource/file;
- No separate file required, no separate discovery path required.
- Much better to keep a tight visible connection between a post and the shortlink for the post. (see Ruby's postulate about metadata / data distance).
A similar algorithm can be applied to an Atom feed with Atom entry elements, using a link element with rel values of alternate and shortlink, and lacking that, nested well-formed (X)HTML in the Atom entry with an element with class name of "shortlink".