website/themes/hugo-theme-relearn/exampleSite/content/shortcodes/icon.en.md
+++ aliases = "/cont/icons" description = "Nice icons for your page" title = "Icon" +++
The icon shortcode displays icons using the Font Awesome library.
{{% icon exclamation-triangle %}} {{% icon angle-double-up %}} {{% icon skull-crossbones %}}
While the examples are using shortcodes with positional parameter you are free to also call this shortcode from your own partials.
{{< tabs groupid="shortcode-parameter">}} {{% tab title="shortcode" %}}
{{%/* icon icon="exclamation-triangle" */%}}
{{%/* icon icon="angle-double-up" */%}}
{{%/* icon icon="skull-crossbones" */%}}
{{% /tab %}} {{% tab title="shortcode (positional)" %}}
{{%/* icon exclamation-triangle */%}}
{{%/* icon angle-double-up */%}}
{{%/* icon skull-crossbones */%}}
{{% /tab %}} {{% tab title="partial" %}}
{{ partial "shortcodes/icon.html" (dict
"page" .
"icon" "exclamation-triangle"
)}}
{{ partial "shortcodes/icon.html" (dict
"page" .
"icon" "angle-double-up"
)}}
{{ partial "shortcodes/icon.html" (dict
"page" .
"icon" "skull-crossbones"
)}}
{{% /tab %}} {{< /tabs >}}
| Name | Position | Default | Notes |
|---|---|---|---|
| icon | 1 | <empty> | Font Awesome icon name to be displayed. It will be displayed in the text color of its according context. |
Browse through the available icons in the Font Awesome Gallery. Notice that the free filter is enabled, as only the free icons are available by default.
Once on the Font Awesome page for a specific icon, for example the page for the heart, copy the icon name and paste into the Markdown content.
Font Awesome provides many ways to modify the icon
Check the full documentation on web fonts with CSS for more.
Built with {{%/* icon heart */%}} by Relearn and Hugo
Built with {{% icon heart %}} by Relearn and Hugo
While the shortcode simplifies using standard icons, the icon customization and other advanced features of the Font Awesome library require you to use HTML directly. Paste the <i> HTML into markup, and Font Awesome will load the relevant icon.
Built with <i class="fas fa-heart"></i> by Relearn and Hugo
Built with <i class="fas fa-heart"></i> by Relearn and Hugo
To use these native HTML elements in your Markdown, add this in your hugo.toml:
[markup.goldmark.renderer]
unsafe = true