pub enum Rel {
Show 13 variants
Alternate,
Author,
Bookmark,
External,
Help,
License,
Next,
Nofollow,
Noopener,
Noreferrer,
Prev,
Search,
Tag,
}Expand description
The rel attribute values for link relationships.
§Purpose
Defines the relationship between the current document and the linked resource, providing semantic meaning for links and enabling special browser behaviors.
§Usage Context
- Used with:
<a>,<area>,<link>,<form>elements - Multiple values: Can be space-separated (e.g., “noopener noreferrer”)
- SEO impact: Values like
nofollowaffect search engine crawling
§Valid Values
Alternate: Alternate representation of the documentAuthor: Link to the document’s authorBookmark: Permalink for the nearest ancestor sectionExternal: Link to a different websiteHelp: Link to context-sensitive helpLicense: Link to copyright/license informationNext: Next document in a sequenceNofollow: Do not follow this link for SEO purposesNoopener: Prevents window.opener access (security)Noreferrer: Don’t send referer header (privacy)Prev: Previous document in a sequenceSearch: Link to a search toolTag: Tag/keyword for the current document
§Example
use ironhtml_attributes::{AttributeValue, Rel};
let rel = Rel::Noopener;
assert_eq!(rel.to_attr_value(), "noopener");<a href="https://external.com" rel="external nofollow">External Site</a>
<a href="/help" rel="help">Help Documentation</a>
<link rel="alternate" href="/feed.xml" type="application/rss+xml">
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Safe Link</a>§WHATWG Specification
Variants§
Alternate
Indicates an alternate representation of the current document, such as translations, RSS feeds, or print versions.
Author
Link to information about the author of the document.
Bookmark
Provides a permalink to the nearest ancestor section.
External
Indicates the link references a resource on a different site.
Help
Link to context-sensitive help information.
License
Link to copyright, license, or legal information for the document.
Next
Indicates the next document in a sequence (pagination, slideshows).
Nofollow
Instructs search engines not to follow this link for ranking purposes.
Noopener
Prevents the new browsing context from accessing window.opener.
Critical security feature for target="_blank" links.
Noreferrer
Prevents the browser from sending the Referer header. Enhances privacy.
Prev
Indicates the previous document in a sequence (pagination, slideshows).
Search
Link to a search tool or interface for the current document.
Tag
Indicates the link represents a tag or keyword for the current document.