+++ title = "External" description = "Create links with external icon and custom behavior." categories = ["navigation"] tags = ["links", "security", "privacy"] html_attributes = ["href", "class", "referrerpolicy", "target", "type", "rel"] custom_attributes = ["text", "trusted"] snippets_used = ["external", "button", "alert"] copyright owner = "Josh Habdas" date = "2019" license = "agpl-3.0-or-later" +++
Basic usage:
{{</* external href="https://after-dark.habd.as" text="After Dark" /*/>}}
{{</* external href="https://after-dark.habd.as" /*/>}}
{{< external href="https://after-dark.habd.as" text="After Dark" />}} {{< external href="https://after-dark.habd.as" />}}
Shorthand usage:
{{</* external "https://after-dark.habd.as" "After Dark" /*/>}}
{{</* external href="https://go.habd.as/after-dark" /*/>}}
{{</* external "wss://fs1.habd.as:80" /*/>}}
{{< external "https://after-dark.habd.as" "After Dark" />}} {{< external href="https://go.habd.as/after-dark" />}} {{< external "wss://fs1.habd.as:80" />}}
{{< hackcss-alert type="info" >}}
Note: URIs such as those using the wss
scheme may be considered unsafe by the {{< external "https://golang.org/pkg/html/template/" "Go template package" />}}. Learn more in the package {{< external "https://golang.org/pkg/html/template/#hdr-Security_Model" "Security Model" />}}.
{{< /hackcss-alert >}}
With a trusted URL:
{{</* external trusted="true" href="wss://fs1.habd.as:80" /*/>}}
{{</* external trusted="true" href="irc://chat.freenode.net:6667/after-dark" /*/>}}
{{< external trusted="true" href="wss://fs1.habd.as:80" />}} {{< external trusted="true" href="irc://chat.freenode.net:6667/after-dark" />}}
With external link styling removed:
{{</* external rel="noopener" href="https://blog.domain.example" /*/>}}
{{< external rel="noopener" href="https://blog.domain.example" />}}
With internal link opening in a new window:
{{</* external href="/404.html" text="Error Page" /*/>}}
{{< external href="/404.html" text="Error Page" />}}
With structured data type:
{{</* external itemtype="significantLink" href="https://habd.as" /*/>}}
{{< external itemtype="significantLink" href="https://habd.as" />}}
With site-wide Referrer Policy overridden:
{{</* external referrerpolicy="unsafe-url" href="http://goo.gl" /*/>}}
{{< external referrerpolicy="unsafe-url" href="http://goo.gl" />}}
With markdown image and link styling removed:
{{%/* external rel="next" href="https://source.unsplash.com/collection/983219/2160x1440" %}}
![Example image](https://source.unsplash.com/collection/983219/1080x720 "View Random Image Enlarged")
{{% /external */%}}
{{% external rel="next" href="https://source.unsplash.com/collection/983219/1080x720" %}} {{% /external %}}
With interactive Button to run a Fuzzy Search:
{{</* external rel="search" target="_self" href="/search/?s=button" >}}
{{< hackcss-button type="primary" text="Search" />}}
{{< /external */>}}
{{< external rel="search" target="_self" href="/search/?s=button" >}} {{< hackcss-button type="primary" text="Search" />}} {{< /external >}}