Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
Gist Shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- image --> | |
| <figure {{ if isset .Params "class" }}class="{{ index .Params "class" }}"{{ end }}> | |
| {{ if isset .Params "link"}}<a href="{{ index .Params "link"}}">{{ end }} | |
| <img src="{{ index .Params "src" }}" {{ if or (isset .Params "alt") (isset .Params "caption") }}alt="{{ if isset .Params "alt"}}{{ index .Params "alt"}}{{else}}{{ index .Params "caption" }}{{ end }}"{{ end }} /> | |
| {{ if isset .Params "link"}}</a>{{ end }} | |
| {{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} | |
| <figcaption>{{ if isset .Params "title" }} | |
| <h4>{{ index .Params "title" }}</h4>{{ end }} | |
| {{ if or (isset .Params "caption") (isset .Params "attr")}}<p> | |
| {{ index .Params "caption" }} | |
| {{ if isset .Params "attrlink"}}<a href="{{ index .Params "attrlink"}}"> {{ end }} | |
| {{ index .Params "attr" }} | |
| {{ if isset .Params "attrlink"}}</a> {{ end }} | |
| </p> {{ end }} | |
| </figcaption> | |
| {{ end }} | |
| </figure> | |
| <!-- image --> |
Instagram Shortcode
YouTube Privacy Enhanced Shortcode
Twitter Shortcode
Hugo 0.24 Released: Big archetype update + @Netlify _redirects etc. file supporthttps://t.co/X94FmYDEZJ #gohugo #golang @spf13 @bepsays
— GoHugo.io (@GoHugoIO) June 21, 2017