Hugo Column shortcode
Shortcode to show content in multiple columns. Can be useful to save space or easily make compact comparisons.
This article was written for Hugo 0.74
.
Usage
There are no options, you can add as many columns as you want they must be split using <--->
. You can use any mark-up and shortcodes within them. Note this shortcode requires to use the %
-syntax (see
this post for more info).
Example
{{% columns %}}
#### Title 1
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
{{< hint warning >}}
Example text that *may* contain **markdown** `markup`.
{{< /hint >}}
<--->
#### Title 2
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
<--->
#### Title 3
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s[^columntest]
{{% /columns %}}
[^columntest]: footnote test in columns
Title 1
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s.
Example text that may contain markdown
markup
.
Title 2
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s
Title 3
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s[^columntest]
Code
The shortcode which is very straight forward, the content is split by <--->
and put in a different container (div). For more info why print
is required see
this post.
|
|
The accompanying SCSS
|
|
- Permalink: //oostens.me/posts/hugo-column-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.