--- title: Webgen::Tag::Link used_options: - tag.link.path - tag.link.attr --- ## Description This tag can be used to generate a link to an (absolute) (localized) canonical path. The generated link will behave exactly like the ones generated by, for example, the breadcrumb trail tag or the menu tag. So it respects the setting of the configuration option `website.link_to_current_page` which means that if this option is set to `false` only a `span` element and not an `a` element is created. The configuration option `tag.link.attr` lets you specify additional HTML options that should be set on the generated link. It can also be used to set the link text via the special `:link_text` key! ## Examples
Usage | Output |
---|---|
\{link: /default.css} | {link: /default.css} |
\{link: link.html} | {link: link.html} |
\{link: link.html#description} | {link: link.html#description} |
\{link: ../} | {link: ../} |
\{link: {path: relocatable.html, attr: {:link_text: A nicer link text, title: Just a title}}} | {link: {path: relocatable.html, attr: {:link_text: A nicer link text, title: Just a title}}} |