Links with attributes
tags: links attributes
Description/Summary
Testing links with different HTML attributes.Content
Links with target attribute
#
This link (to Hyperlinks chapter in Org manual) will open in a new tab
as it is annotated with target="_blank".
Here’s the same link but with target="_self" annotation. So
clicking it will open that link in this same tab!
Here’s the same link again, but this time there is no #+attr_html
annotation. So the behavior of clicking this link will depend on the
browser (typically an external link will open in a new tab
automatically).
Image linked to image with target attribute
#
ox-hugo Issue #133
Above is an hyperlinked image with the HTML attributes set as
#+attr_html: :width 10% :target _self in Org.
- The
widthattribute of 10% must apply only to the image, and not to the link. - And the
target="_self"attribute must apply only to the link, and not the image. So, clicking that image will open the linked image in the same browser tab because thetargetis set to"_self"(Hugo v0.37+ — fixed inhugoPR #4382).
Here’s an inline hyperlinked image with the exact same HTML
attributes:
. So,
clicking this image too should open the linked image in the same
brower tab.
Links with title and style attributes
#
Page (Debug)
| Page Variable | Value | |
|---|---|---|
| Name | "Links with attributes" | |
| Title | "Links with attributes" | |
| ResourceType | "page" | |
| Kind | "page" | |
| Section | "posts" | |
| Draft | false | |
| Type | "posts" | |
| Layout | "" | |
| Permalink | "https://ox-hugo.scripter.co/test/posts/links-with-attributes/" | |
| RelPermalink | "/posts/links-with-attributes/" | |
| Data |
| |
| NextPage | Links to tables | |
| PrevPage | Make the author front-matter plural | |
| NextInSection | Links to tables | |
| PrevInSection | Make the author front-matter plural |
Page Params (Debug)
| Key | Type | Value |
|---|---|---|
| aliases | []string | "/posts/links-with-target-attribute" |
| description | string | "Testing links with different HTML attributes." |
| draft | bool | false |
| iscjklanguage | bool | false |
| lastmod | time.Time | 2022-02-23 16:35:22 -0500 -0500 |
| tags | []string | "links" "attributes" |
| title | string | "Links with attributes" |
File Object (Debug)
| FileInfo Variable | Value |
|---|---|
| UniqueID | "1ff8600c088bfaae39d607efef19bd3a" |
| BaseFileName | "links-with-attributes" |
| TranslationBaseName | "links-with-attributes" |
| Lang | "en" |
| Section | "posts" |
| LogicalName | "links-with-attributes.md" |
| Dir | "posts/" |
| Ext | "md" |
| Path | "posts/links-with-attributes.md" |