Hugo Button shortcode
Shortcode which shows links as buttons which can be used to emphasize them or as a call for action.
This article was written for Hugo 0.74
.
Usage
You configure the link target, set the content of the button and you’re done.
option | effect | optional | default |
---|---|---|---|
href | sets the link to an external website | yes | Attachments |
relref | sets a link to a page on the current website. If set href is ignored | yes | |
class | optional CSS classes | yes |
Example
{{< button relref="/" >}}Get Home{{< /button >}}
{{< button href="https://gohugo.io/" >}}Hugo{{< /button >}}
Code
The shortcode, which is just a stylized <a>
element.
|
|
The accompanying SCSS
|
|
- Permalink: //oostens.me/posts/hugo-button-shortcode/
- License: The text and content is licensed under CC BY-NC-SA 4.0. All source code I wrote on this page is licensed under The Unlicense; do as you please, I'm not liable nor provide warranty.
Noticed an error in this post? Corrections are
spam.appreciated.