Sometimes, we use the rel
attribute do convey meaning to a link to a specific page or page fragment, like so:
<link rel="author" href="https://example.com/humans.txt">
<a rel="bookmark" href="https://example.com/page#thing">thing</a>
So far, so good.
Case
Now say I have a glossary page, https://example.com/glossary
, and on that page, I have a definition list with a bunch of terms:
<dl id="dictionary">
<dt id="foo">foo</dt>
<dd>A foo is not a <a href="#bar">bar</a>.</dd>
<dt id="bar">bar</dt>
<dd>A metric unit of pressure that serves alcoholic beverages.</dd>
</dl>
This makes we wonder what the proper/best way is to link to the glossary, and to a specific term in said glossary. I’ve come up with the following options:
For the glossary:
1. <link rel="glossary" href="https://example.com/glossary">
2. <link rel="glossary" href="https://example.com/glossary#dictionary">
For a specific term:
1. <a rel="bookmark" href="https://example.com/glossary#bar">bar</a>
2. <a rel="glossary" href="https://example.com/glossary#bar">bar</a>
3. <a rel="bookmark glossary" href="https://example.com/glossary#bar">bar</a>
4. <a href="https://example.com/glossary#bar">bar</a>
What do you think are the best options, and why? Please note that it’s entirely possible the best way is something I have not considered.