Hugo Shortcodes
Hugo shortcodes include relatively complicated HTML in your Markdown document. Some examples:
- YouTube
- Notes and Warnings
- GitHub gists.
Adding a YouTube video
{ {% youtube 2WTWx0yknQQ %} }
Note: no spaces between the braces!
Adding a tweet
{ {% tweet 817461069014859780 %} }
Note: no spaces between the braces!
The bookdown book package just arrived at my door. Love the Alegreya & Source Code Pro fonts on paper. Also happy that the book is so thin! pic.twitter.com/kr21J19Cw1
— Yihui Xie (@xieyihui) January 6, 2017
Adding Instagram
{ {% instagram BWNjjyYFxVx hidecaption %} }
Note: no spaces between the braces!
Add a note or a warning
{ {% alert note %} }
Here’s a tip or note…
{ {% /alert %} }
Here’s a tip or note…
{ {% alert warning %} }
Don’t try this at home!
{ {% /alert %} }
Don’t try this at home!
Add a GitHub gist:
Suppose that we want to include the gist at the following URL:
We can use:
{ {% gist spf13 7896402 %} }